aminvakil / docker-ocserv

OpenConnect VPN Server Docker
https://quay.io/aminvakil/ocserv
82 stars 35 forks source link

User add issue #66

Closed moel13 closed 5 months ago

moel13 commented 5 months ago

Hello I have a problem with adding user:

~# docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd alex Enter password: Re-enter password: file '/etc/ocserv/ocpasswd' is locked.

This error occurred. Guide me please.

aminvakil commented 5 months ago

How have you installed docker-ocserv at the first place? Please paste the full commands from the beginning.

moel13 commented 5 months ago

docker run --name ocserv --sysctl net.ipv4.ip_forward=1 --cap-add NET_ADMIN --security-opt no-new-privileges -p 443:443 -p 443:443/udp -e NO_TEST_USER=1 -v /ocsrv/ocpasswd:/etc/ocserv/ocpasswd -d quay.io/aminvakil/ocserv

aminvakil commented 5 months ago

Yes, because as you have passed NO_TEST_USER=1 no file gets created, therefore this error.

You should either create this file on host yourself and set appropriate permissions, or do not pass NO_TEST_USER environment, let it gets created with a test user, then add your new user and remove the test user.