LINUX.ORG.RU
ФорумAdmin

pptpd: добавить инфу в логи


0

0

Хочется, чтобы при подсоединении клиента по pptp в лог писался его логин и прочая информация. Сейчас пишутся только варнинги про несуществующие адреса IPv6.

В манах по pptp, pppd, ppp упоминается опция «set log», но нигде не описаны её параметры...


Debian lenny, все ок:

May 14 14:40:29 xxx pppd[10156]: pptpd-logwtmp.so ip-up ppp0 user1 91.xx.xx.xx

Выдержка из /etc/pptpd.conf

# TAG: debug

# Turns on (more) debugging to syslog

debug

# TAG: logwtmp

# Use wtmp(5) to record client connections and disconnections.

logwtmp

gh0stwizard ★★★★★
()
Ответ на: комментарий от gh0stwizard

Сделал всё это, в ppp.conf включил самый полный debug, тогда появляются вот такие строчки:

May 18 16:40:17 nexus ppp[18826]: tun0: Physical: 30 2a 75 c4 a1 f9 67 7d 20 6f 6c 65 67 7d 35 4b 0*u\M-D\M-!\M-yg} vpntest}5K
May 18 16:40:17 nexus ppp[18826]: tun0: Async: 30 2a 75 c4 a1 f9 67 7d 20 6f 6c 65 67 7d 35 4b 0*u\M-D\M-!\M-yg} vpntest}5K
May 18 16:40:17 nexus ppp[18826]: tun0: HDLC: 30 2a 75 c4 a1 f9 67 00 6f 6c 65 67 15 4b 0*u\M-D\M-!\M-yg.vpntest.K
May 18 16:40:17 nexus ppp[18826]: tun0: Phase: Chap Input: RESPONSE (49 bytes from vpntest)

Есть какая-то опция, чтобы в явном виде в лог выплёвывался логин? Не по умолчанию, а опция какая-то именно.

tx
() автор топика
Ответ на: комментарий от gh0stwizard

И еще проверь логи /var/log/messages, /var/log/daemon, /var/log/debug. В зависимости от настроек syslog сообщения могут быть раскиданы по разным лог-файлам. Может всетаки и пишется, но ты не там ищешь.

gh0stwizard ★★★★★
()
Ответ на: комментарий от gh0stwizard

> Сделай grep по pptpd, а не ppp.

Это греп по логину vpntest. Проверял всё что нашёл в /var/log, дополнительно включил в syslog запись debug.

И еще проверь логи /var/log/messages, /var/log/daemon, /var/log/debug.

Уже.

Нашёл ещё /etc/ppp/ppp.linkup, там можно сделать скрипт выплёвывающий в файл параметры подсоединившегося клиента, но там нет собственно логина (или я этот параметр не нашёл), что делает всю затею бессмысленной.

tx
() автор топика
Ответ на: комментарий от tx

Тогда, давай вывод лога с опцией dump на pastebin. Ну и в кратце OS, версию поптопа. Либо это баг, либо у тебя специфично собран pptpd, т.к. по идее за все логи у меня отвечает модуль pptpd-logwtmp.so (по ходу у тебя его нет).

gh0stwizard ★★★★★
()
Ответ на: комментарий от gh0stwizard

Короче выяснил, только легче от этого не стало.

OpenBSD 4.6, поптоп последний. Там действительно от него оторван logwtmp, а собрать из родных исходников (где этот самый logwtmp присутствует) невозможно, сборка валится с миллионом ошибок. Пробовал даже из исходников поптопа собирать отдельно этот самый .so, оно собралось, только опеновский поптоп не понимает даже параметр «plugin» в конфиге. В общем либо каждому юзеру IP привязывать, либо я не знаю :(

tx
() автор топика
Ответ на: комментарий от tx

Можно попробовать это

kdebug n

Enable debugging code in the kernel-level PPP driver. The argument n is a number which is the sum of the following values:

1 to enable general debug messages, 2 to request that the contents of received packets be printed, and 4 to request that

the contents of transmitted packets be printed. On most systems,

messages printed by the kernel are logged by syslogd(8) to a file

as directed in the /etc/syslog.conf configuration file.

http://www.openbsd.org/cgi-bin/man.cgi?query=pppd&sektion=8

gh0stwizard ★★★★★
()
Ответ на: комментарий от tx

Последний вариант:

name name

Set the name of the local system for authentication purposes to

name. This is a privileged option. With this option, pppd will

use lines in the secrets files which have name as the second

field when looking for a secret to use in authenticating the

peer. In addition, unless overridden with the user option, name

will be used as the name to send to the peer when authenticating

the local system to the peer. (Note that pppd does not append

the domain name to name.)

gh0stwizard ★★★★★
()
Ответ на: комментарий от tx

/etc/ppp/auth-up

A program or script which is executed after the remote system successfully authenticates itself. It is exe- cuted with the parameters

interface-name peer-name user-name tty-device speed

Note that this script is not executed if the peer doesn’t authenticate itself, for example when the noauth option is used.

ansky ★★★★★
()
Ответ на: комментарий от ansky

Создал, +x поставил, не вызывается оно что-то. Хотя в мане на pppd оно действительно есть...

tx
() автор топика
Ответ на: комментарий от gh0stwizard

> name name

В логах ничего не прибавилось.

tx
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.