B
B
bugaga01123582012-01-31 05:44:26
webmin
bugaga0112358, 2012-01-31 05:44:26

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

/etc/ppp/options.pptpd:
name pptpd
# Auth
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
nomppe-40
# Network
nodefaultroute
ms-dns 192.168.202.1
proxyarp
nobsdcomp

Maybe someone faced similar?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bugaga0112358, 2012-02-01
@bugaga0112358

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

And then I slightly modified the Webmin file /usr/share/webmin/pptp-server/list_conns.cgi, adding a few lines of my own to the output loop of the connection table.
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();
        }

The result satisfied the authorities, and I was left with a small residue. Still, I want to know how it actually works there =)

V
Vladimir Lobanov, 2014-12-05
@Stealch

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 question

Ask a Question

731 491 924 answers to any question