Sign inSign up

1247004718/pptp-server

By 1247004718

•Updated almost 5 years ago

pptp-server

Image
0

2.9K

1247004718/pptp-server repository overview

#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

⁠get the username/ppp line number from the parameters

PPPLINE=$1 USER=$2

⁠create the directory to keep pid files per user

mkdir -p /var/run/pptpd-users

⁠if there is a session already for this user, terminate the old one

if [ -f /var/run/pptpd-users/$USER ]; then kill -HUP cat /var/run/pptpd-users/$USER rm /var/run/pptpd-users/$USER fi

⁠write down the username in the ppp line file

echo $USER > /var/run/pptpd-users/$PPPLINE.new The second file is /etc/ppp/ip-up.local

#!/bin/sh REALDEVICE=$1

⁠Get the username from the ppp line record file

USER=cat /var/run/pptpd-users/$REALDEVICE.new

⁠Copy the ppp line pid

cp "/var/run/$REALDEVICE.pid" /var/run/pptpd-users/$USER

⁠remove the ppp line record file

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.)

Tag summary

Content type

Image

Digest

Size

63.5 MB

Last updated

almost 5 years ago

docker pull 1247004718/pptp-server