[GH-ISSUE #26] 请问如何添加多个用户呢? #24

Closed
opened 2026-03-02 07:11:08 +03:00 by kerem · 5 comments
Owner

Originally created by @PangciPG on GitHub (May 9, 2017).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/26

请问如何添加多个用户呢?
另外
centos7上安装后:win7,Mac均成功
安卓手机有问题,xauth PSK模式可连接但无网络,l2tp/ipsec psk模式无法连接

Originally created by @PangciPG on GitHub (May 9, 2017). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/26 请问如何添加多个用户呢? 另外 centos7上安装后:win7,Mac均成功 安卓手机有问题,xauth PSK模式可连接但无网络,l2tp/ipsec psk模式无法连接
kerem closed this issue 2026-03-02 07:11:08 +03:00
Author
Owner

@hwdsl2 commented on GitHub (May 9, 2017):

@drliuyb To add multiple VPN users to the Docker container, follow these steps:

First, start a Bash session in the running container:

docker exec -it ipsec-vpn-server env TERM=xterm bash -l

Install the nano editor:

apt-get update && apt-get -y install nano

Follow these instructions to add multiple users:
https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md

(Important) Edit /opt/src/run.sh using nano, and comment out lines 202-212:
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L202-L212

To fix the Android issue, replace sha2-truncbug=yes with sha2-truncbug=no in /etc/ipsec.conf. See: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#android-6-and-7

When finished, exit the container and restart it:

exit
docker restart ipsec-vpn-server
<!-- gh-comment-id:300171897 --> @hwdsl2 commented on GitHub (May 9, 2017): @drliuyb To add multiple VPN users to the Docker container, follow these steps: First, start a Bash session in the running container: ``` docker exec -it ipsec-vpn-server env TERM=xterm bash -l ``` Install the nano editor: ``` apt-get update && apt-get -y install nano ``` Follow these instructions to add multiple users: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md (**Important**) Edit `/opt/src/run.sh` using `nano`, and comment out lines 202-212: https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L202-L212 To fix the Android issue, replace `sha2-truncbug=yes` with `sha2-truncbug=no` in `/etc/ipsec.conf`. See: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#android-6-and-7 When finished, exit the container and restart it: ``` exit docker restart ipsec-vpn-server ```
Author
Owner

@greenmickey123 commented on GitHub (Oct 30, 2018):

@drliuyb To add multiple VPN users to the Docker container, follow these steps:

First, start a Bash session in the running container:

docker exec -it ipsec-vpn-server env TERM=xterm bash -l

Install the nano editor:

apt-get update && apt-get -y install nano

Follow these instructions to add multiple users:
https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md

(Important) Edit /opt/src/run.sh using nano, and comment out lines 202-212:
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L202-L212

To fix the Android issue, replace sha2-truncbug=yes with sha2-truncbug=no in /etc/ipsec.conf. See: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#android-6-and-7

When finished, exit the container and restart it:

exit
docker restart ipsec-vpn-server

I added a VPN client using the method mentioned above but I just still cannot use the new user and password to connect to my server. The server returned 'User authentication failed' when I tried to connect the server.
I can just use the first username and password created from :
https://github.com/hwdsl2/docker-ipsec-vpn-server

Can anyone help me fix this problem?

<!-- gh-comment-id:434164299 --> @greenmickey123 commented on GitHub (Oct 30, 2018): > @drliuyb To add multiple VPN users to the Docker container, follow these steps: > > First, start a Bash session in the running container: > > ``` > docker exec -it ipsec-vpn-server env TERM=xterm bash -l > ``` > Install the nano editor: > > ``` > apt-get update && apt-get -y install nano > ``` > Follow these instructions to add multiple users: > https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/manage-users-zh.md > > (**Important**) Edit `/opt/src/run.sh` using `nano`, and comment out lines 202-212: > https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L202-L212 > > To fix the Android issue, replace `sha2-truncbug=yes` with `sha2-truncbug=no` in `/etc/ipsec.conf`. See: https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#android-6-and-7 > > When finished, exit the container and restart it: > > ``` > exit > docker restart ipsec-vpn-server > ``` I added a VPN client using the method mentioned above but I just still cannot use the new user and password to connect to my server. The server returned 'User authentication failed' when I tried to connect the server. I can just use the first username and password created from : https://github.com/hwdsl2/docker-ipsec-vpn-server Can anyone help me fix this problem?
Author
Owner

@hwdsl2 commented on GitHub (Oct 30, 2018):

@greenmickey123 Did you comment out these lines [1] in /opt/src/run.sh? Double check that your new user has been added by starting a Bash session in the running container and then check the contents of /etc/ppp/chap-secrets and /etc/ipsec.d/passwd:

docker exec -it ipsec-vpn-server env TERM=xterm bash -l
cat /etc/ppp/chap-secrets
cat /etc/ipsec.d/passwd

If the new user does not exist in those files, re-add them, then comment out the lines mentioned above in /opt/src/run.sh, and finally exit the container and restart it:

exit
docker restart ipsec-vpn-server

Also check your VPN client settings for any typo in VPN credentials.

[1] https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L205-L213

<!-- gh-comment-id:434167692 --> @hwdsl2 commented on GitHub (Oct 30, 2018): @greenmickey123 Did you comment out these lines [1] in `/opt/src/run.sh`? Double check that your new user has been added by starting a Bash session in the running container and then check the contents of `/etc/ppp/chap-secrets` and `/etc/ipsec.d/passwd`: ``` docker exec -it ipsec-vpn-server env TERM=xterm bash -l cat /etc/ppp/chap-secrets cat /etc/ipsec.d/passwd ``` If the new user does not exist in those files, re-add them, then comment out the lines mentioned above in `/opt/src/run.sh`, and finally exit the container and restart it: ``` exit docker restart ipsec-vpn-server ``` Also check your VPN client settings for any typo in VPN credentials. [1] https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L205-L213
Author
Owner

@greenmickey123 commented on GitHub (Oct 30, 2018):

@greenmickey123 Did you comment out these lines [1] in /opt/src/run.sh? Double check that your new user has been added by starting a Bash session in the running container and then check the contents of /etc/ppp/chap-secrets and /etc/ipsec.d/passwd:

docker exec -it ipsec-vpn-server env TERM=xterm bash -l
cat /etc/ppp/chap-secrets
cat /etc/ipsec.d/passwd

If the new user does not exist in those files, re-add them, then comment out the lines mentioned above in /opt/src/run.sh, and finally exit the container and restart it:

exit
docker restart ipsec-vpn-server

Also check your VPN client settings for any typo in VPN credentials.

[1] https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L205-L213

Problem solved!
I use IPsec/XAuth ("Cisco IPsec") for connection but I did not modify the file /etc/ipsec.d/passwd . That's why I failed! Thank you!

<!-- gh-comment-id:434173145 --> @greenmickey123 commented on GitHub (Oct 30, 2018): > @greenmickey123 Did you comment out these lines [1] in `/opt/src/run.sh`? Double check that your new user has been added by starting a Bash session in the running container and then check the contents of `/etc/ppp/chap-secrets` and `/etc/ipsec.d/passwd`: > > ``` > docker exec -it ipsec-vpn-server env TERM=xterm bash -l > cat /etc/ppp/chap-secrets > cat /etc/ipsec.d/passwd > ``` > If the new user does not exist in those files, re-add them, then comment out the lines mentioned above in `/opt/src/run.sh`, and finally exit the container and restart it: > > ``` > exit > docker restart ipsec-vpn-server > ``` > Also check your VPN client settings for any typo in VPN credentials. > > [1] https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/run.sh#L205-L213 Problem solved! I use IPsec/XAuth ("Cisco IPsec") for connection but I did not modify the file `/etc/ipsec.d/passwd` . That's why I failed! Thank you!
Author
Owner

@greenmickey123 commented on GitHub (Oct 31, 2018):

If I want to install vnStat on docker, do I need to operate it in a Bash session? Also, can I set traffic limit for each user? Can you show me how to do that?

<!-- gh-comment-id:434553042 --> @greenmickey123 commented on GitHub (Oct 31, 2018): If I want to install vnStat on docker, do I need to operate it in a Bash session? Also, can I set traffic limit for each user? Can you show me how to do that?
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#24
No description provided.