Most of the logs recorded by the logon username pptpd in linuxPPTPVPN are in the/var/log/messages,/var/log/daemon files. However, you can see that there is no username in the logs, I don't know which account the user used to log on. So I took a look at pppd man ,...
Most of the logs for logging on to the linux pptp vpn user name pptpd are stored in files such as/var/log/messages,/var/log/daemon. However, after careful reading, the user name is not found in the logs, I don't know which account the user used to log on. So I looked at pppd man and found some environment variables, such as IPLOCAL and IPREMOTE. after testing, I found that PEERNAME is the user name, in this way, you can record in/etc/ppp/ip-up and/etc/ppp/ip-down, and no user ip address is found. Later, we found that pppd is a sub-process of spawn to control the pptpd connection. the sub-process command line already contains the user's ip address. after many experiments, the command line parameter is found when ip-up is called. $6 is the user's ip address, so I wrote it in ip-up by using the echo command, it is a complete log of pptpd, including time, source ip address, user name, and ip address of the allocated ppp. my specific operations are as follows: add the script www.2cto.com Java code 1 to/etc/ppp/ip-up and/etc/ppp/ip-down. echo "time: 'Date-d today + % F _ % t'">/var/log/pptpd. log 2. echo "clientIP: $6" >>/ var/log/pptpd. log 3. echo "username: $ PEERNAME">/var/log/pptpd. log 4. echo "device: $1" >>/ var/log/pptpd. log 5. echo "vpnIP: $4" >>/ var/log/pptpd. log 6. echo "assignIP: $5" >>/ var/log/pptpd. log author gaoming655
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.