#mkdir -p /etc/ppp
#touch /etc/ppp/chap-secrets
#echo "# Secrets for authentication using PAP" > /etc/ppp/chap-secrets
#echo "# client server secret acceptable local IP addresses" >> /etc/ppp/chap-secrets
#echo "guest * 123456 *" >> /etc/ppp/chap-secrets
#docker run -d --privileged --name pptpd --net=host -v /etc/ppp/chap-secrets:/etc/ppp/chap-secrets 1247004718/pptp-server
only one
By default, a user can make multiple connections to the pptpd server. To restrict one connection per user, create two script files in the /etc/ppp directory. When the same user logs in twice, the first connection will be disconnected. This is actually done on the ppp level, not with the pptpd.
The first file is /etc/ppp/auth-up
#!/bin/sh
PPPLINE=$1 USER=$2
mkdir -p /var/run/pptpd-users
if [ -f /var/run/pptpd-users/$USER ]; then
kill -HUP cat /var/run/pptpd-users/$USER
rm /var/run/pptpd-users/$USER
fi
echo $USER > /var/run/pptpd-users/$PPPLINE.new The second file is /etc/ppp/ip-up.local
#!/bin/sh REALDEVICE=$1
USER=cat /var/run/pptpd-users/$REALDEVICE.new
cp "/var/run/$REALDEVICE.pid" /var/run/pptpd-users/$USER
rm "/var/run/pptpd-users/$REALDEVICE.new" The method presented here may not be the best one, but it works for me. (If you have a better way, please let me know.)
Content type
Image
Digest
Size
63.5 MB
Last updated
almost 5 years ago
docker pull 1247004718/pptp-server