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