Answer the question
In order to leave comments, you need to log in
PoPToP(Webmin 1.580)+wtmp: User logins not showing / Ubuntu Server 11.04?
Good day, dear ones.
There was such a problem: webmin does not display the logins of active users connected to the pptp server.
At the same time, the last command displays these logins correctly, the wtmp-log is kept.
pptp server config:
speed 115200
option /etc/ppp/options.pptpd
bcrelay eth0
lock
debug
localip 192.168.202.1
remoteip 192.168.202.2-200
logwtmp
name pptpd
# Auth
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
nomppe-40
# Network
nodefaultroute
ms-dns 192.168.202.1
proxyarp
nobsdcomp
Answer the question
In order to leave comments, you need to log in
In general, I decided to file the solution myself.
I created a script that allows you to get the login of a VPN user by the name of the interface that is raised for him.
#!/bin/bash
# $1 - interface name
# Task: get username by interface name
LOG=$(last | grep $1 | grep still | cut -f 1 -d ' ')
LOGIN=$(grep $LOG /etc/ppp/chap-secrets | cut -f 1 -d ' ')
LOGIN=${LOGIN//[\"]/}
echo $LOGIN
foreach $c (@conns) {
# bugaga0112358 - Prepare command
$cmd = 'listclient '.$c->[3];
# bugaga0112358 - Execute command
$c->[7] = `$cmd`;
local @cols;
push(@cols, "<a href='disc.cgi?pid=$c->[0]'>".
($c->[3] ? "<tt>$c->[3]</tt>"
: $text{'conns_unknown'})."</a>");
push(@cols, $c->[2]);
push(@cols, $c->[6] || $text{'conns_unknown'});
push(@cols, $c->[4] ? "<tt>$c->[4]</tt>"
: $text{'conns_unknown'});
push(@cols, $c->[5] ? "<tt>$c->[5]</tt>"
: $text{'conns_unknown'});
push(@cols, $c->[7] ? "<tt>$c->[7]</tt>"
: $text{'conns_unknown'});
print &ui_columns_row(\@cols);
}
print &ui_columns_end();
}
Great method. Works with a bang. It's been 2 years now, but nothing has changed in the official version of webmin... unfortunately this bastard only recognizes REAL users with login credentials. With your amendment, this problem is stopped with a bang. Thank you.
PS After updating Webmin, do not forget to take a tambourine and fix list_conns.cgi again =))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question