[GH-ISSUE #5] 怎么创建多个用户呢 #6

Closed
opened 2026-03-02 07:10:58 +03:00 by kerem · 7 comments
Owner

Originally created by @yuyc on GitHub (Jul 20, 2016).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/5

如题,我ipsec的vpn想给多个人用,怎么创建多个用户呢,谢谢

Originally created by @yuyc on GitHub (Jul 20, 2016). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/5 如题,我ipsec的vpn想给多个人用,怎么创建多个用户呢,谢谢
kerem closed this issue 2026-03-02 07:10:58 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Jul 20, 2016):

@yuyc To add more users, first get a shell inside the container:

docker exec -it ipsec-vpn-server /bin/bash

Then edit /etc/ppp/chap-secrets (for IPsec/L2TP) and /etc/ipsec.d/passwd (for IPsec/XAuth):

export TERM=xterm
apt-get update && apt-get install nano
nano /etc/ppp/chap-secrets
nano /etc/ipsec.d/passwd

Refer to [1] for the format of those files. When finished, exit the container. Then restart it:

docker restart ipsec-vpn-server

[1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md

<!-- gh-comment-id:233823312 --> @hwdsl2 commented on GitHub (Jul 20, 2016): @yuyc To add more users, first get a shell inside the container: ``` docker exec -it ipsec-vpn-server /bin/bash ``` Then edit `/etc/ppp/chap-secrets` (for IPsec/L2TP) and `/etc/ipsec.d/passwd` (for IPsec/XAuth): ``` export TERM=xterm apt-get update && apt-get install nano nano /etc/ppp/chap-secrets nano /etc/ipsec.d/passwd ``` Refer to [1] for the format of those files. When finished, `exit` the container. Then restart it: ``` docker restart ipsec-vpn-server ``` [1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md
Author
Owner

@hwdsl2 commented on GitHub (Jul 20, 2016):

@yuyc To add to my previous reply... Before you exit the container, please edit /opt/src/run.sh and comment out the following lines, in order to prevent the config files from being overwritten at restart:

nano /opt/src/run.sh

Comment out these lines:

# Create VPN credentials
cat > /etc/ppp/chap-secrets <<EOF
# Secrets for authentication using CHAP
# client  server  secret  IP addresses
"$VPN_USER" l2tpd "$VPN_PASSWORD" *
EOF

VPN_PASSWORD_ENC=$(openssl passwd -1 "$VPN_PASSWORD")
cat > /etc/ipsec.d/passwd <<EOF
$VPN_USER:$VPN_PASSWORD_ENC:xauth-psk
EOF
<!-- gh-comment-id:233823921 --> @hwdsl2 commented on GitHub (Jul 20, 2016): @yuyc To add to my previous reply... Before you exit the container, please edit `/opt/src/run.sh` and comment out the following lines, in order to prevent the config files from being overwritten at restart: ``` nano /opt/src/run.sh ``` Comment out these lines: ``` # Create VPN credentials cat > /etc/ppp/chap-secrets <<EOF # Secrets for authentication using CHAP # client server secret IP addresses "$VPN_USER" l2tpd "$VPN_PASSWORD" * EOF VPN_PASSWORD_ENC=$(openssl passwd -1 "$VPN_PASSWORD") cat > /etc/ipsec.d/passwd <<EOF $VPN_USER:$VPN_PASSWORD_ENC:xauth-psk EOF ```
Author
Owner

@yuyc commented on GitHub (Jul 20, 2016):

好的,谢谢楼主了,没想到回复速度这么快,已经使用你另外一个项目搭建好了ipsec-vpn,后续再跑docker时用你的方法。

<!-- gh-comment-id:233831232 --> @yuyc commented on GitHub (Jul 20, 2016): 好的,谢谢楼主了,没想到回复速度这么快,已经使用你另外一个项目搭建好了ipsec-vpn,后续再跑docker时用你的方法。
Author
Owner

@hwdsl2 commented on GitHub (Jul 20, 2016):

👍

<!-- gh-comment-id:233833424 --> @hwdsl2 commented on GitHub (Jul 20, 2016): :+1:
Author
Owner

@birkhofflee commented on GitHub (Aug 25, 2016):

Any plans for automating this process?

<!-- gh-comment-id:242373180 --> @birkhofflee commented on GitHub (Aug 25, 2016): Any plans for automating this process?
Author
Owner

@hwdsl2 commented on GitHub (Aug 25, 2016):

@BirkhoffLee Sorry, not planned at this time.

<!-- gh-comment-id:242403278 --> @hwdsl2 commented on GitHub (Aug 25, 2016): @BirkhoffLee Sorry, not planned at this time.
Author
Owner

@wolfwithsheep commented on GitHub (Nov 12, 2020):

Dear, any plans for automating this process recently? And after i created new users, how can i check the users's status?

<!-- gh-comment-id:725964550 --> @wolfwithsheep commented on GitHub (Nov 12, 2020): Dear, any plans for automating this process recently? And after i created new users, how can i check the users's status?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#6
No description provided.