- Install Docker
1.1. Install certobt
sudo apt install certbot
sudo certbot certonly --standalone -d you.domain.net --email [email protected] --agree-tos --non-interactive
sudo systemctl list-timers | grep certbot
- Build docker image
git clone https://github.com/mogilevich/OpenConnect-Cisco-AnyConnect-VPN-Server-OneKey-ocserv.git
cd OpenConnect-Cisco-AnyConnect-VPN-Server-OneKey-ocserv/
docker build . -t ocserv
#docker build -t ocserv https://github.com/mogilevich/OpenConnect-Cisco-AnyConnect-VPN-Server-OneKey-ocserv.git
- Run docker container
docker run -d \
-v /etc/letsencrypt/live/you.domain.net/fullchain.pem:/etc/ocserv/certs/server-cert.pem:ro\
-v /etc/letsencrypt/live/you.domain.net/privkey.pem:/etc/ocserv/certs/server-key.pem:ro\
--name ocserv_container\
--restart=always\
--privileged -p 443:443 -p 443:443/udp ocserv
- Add user
docker exec -ti ocserv_container ocpasswd -c /etc/ocserv/ocpasswd testUserName
- Change user password
docker exec -ti ocserv_container ocpasswd -c /etc/ocserv/ocpasswd testUserName
- Delete user
docker exec -ti ocserv_container ocpasswd -c /etc/ocserv/ocpasswd -d testUserName
- Lock user
docker exec -ti ocserv_container ocpasswd -c /etc/ocserv/ocpasswd -l testUserName
- Unlock user
docker exec -ti ocserv_container ocpasswd -c /etc/ocserv/ocpasswd -u testUserName
- Show all users and their hashed password
docker exec -ti ocserv_container cat /etc/ocserv/ocpasswd
- Import list user
cd user_managment/
nano users.txt
./add_users.sh
- Easy install
- Easy uninstall
- Add User
- Change Password
- Show All Users
- Delete User
- Lock User
- Unlock User
For making connection to your server, you can use AnyConnect
, OpenConnect
or other alternative clients.
- AnyConnect: GUI AnyConnect client for available platforms.
- OpenConnect: OpenConnect client for Linux.
And one more thing, contributions are welcome.
The script is based on here