

Manage VPN Users

By default, a single user account for VPN login is created.
If you wish to add, edit or remove users,
read IPSec VPN User management.

The IPsec PSK (pre-shared key) is stored in./etc/ipsec.secrets
All VPN users share the same IPsec PSK.
You can set a new one by changing the line:

%any %any : PSK "your_new_ipsec_pre_shared_key"
For IPsec/L2TP, VPN users are specified in

#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
/etc/ppp/chap-secrets. The format of this file is:

"your_vpn_username_1" l2tpd "your_vpn_password_1" *
"your_vpn_username_2" l2tpd "your_vpn_password_2" *

#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#

-----------------------------------------------------

For IPsec/XAuth ("Cisco IPsec"),
VPN users are specified in /etc/ipsec.d/passwd.
The format of this file is:
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#

openssl passwd -1 'your_vpn_password_1'

hckao@x96:/etc$ sudo openssl passwd -1 kbt2x6
$1$bSbRTGEw$JAVd0j4GP1PNawqR
hckao@x96:/etc$

#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
/etc/ipsec.d/passwd.

your_vpn_username_1:your_vpn_password_1_hashed:xauth-psk
your_vpn_username_2:your_vpn_password_2_hashed:xauth-psk
hckao:$1$0tM.UqLq$N3DMYue9rVkKJz3k92fmU0:xauth-psk
... ... ... ... ... ... ...
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#


Passwords in this file are salted and hashed. This step can be done using e.g. the openssl utility:

# The output will be your_vpn_password_1_hashed
--- --- --- --- --- --- --- --- ---

openssl passwd -1 'your_vpn_password_1'

--- --- --- --- --- --- --- --- --- ---


Finally, restart services if you changed to a new PSK.
For add, edit or remove VPN users,
a restart is normally not required.

#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
openvpn

cd /home/hckao/openvpn-install
sudo ./openvpn-install.sh

Looks like OpenVPN is already installed.

What do you want to do?
   1) Add a new user
   2) Revoke an existing user
   3) Remove OpenVPN
   4) Exit
Select an option [1-4]:



#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#
#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#


sudo service ipsec restart ||
sudo systemctl restart ipsec

sudo service xl2tpd restart ||
sudo systemctl restart xl2tpd

sudo nano /etc/ipsec.secrets
sudo nano /etc/ppp/chap-secrets
sudo nano /etc/ipsec.d/passwd

sudo cat /etc/ipsec.secrets
sudo cat /etc/ppp/chap-secrets
sudo cat /etc/ipsec.d/passwd


 cat add-user

Manage VPN Users

By default, a single user account for VPN login is created.
If you wish to add, edit or remove users,
read IPSec VPN User management.

The IPsec PSK (pre-shared key) is stored in./etc/ipsec.secrets
All VPN users share the same IPsec PSK.
You can set a new one by changing the line:

%any %any : PSK "your_new_ipsec_pre_shared_key"
For IPsec/L2TP, VPN users are specified in

#####################

/etc/ppp/chap-secrets. The format of this file is:

"your_vpn_username_1" l2tpd "your_vpn_password_1" *
"your_vpn_username_2" l2tpd "your_vpn_password_2" *

#####################

-----------------------------------------------------

For IPsec/XAuth ("Cisco IPsec"),
VPN users are specified in /etc/ipsec.d/passwd.
The format of this file is:
#####################

openssl passwd -1 'your_vpn_password_1'


#####################

/etc/ipsec.d/passwd.

your_vpn_username_1:your_vpn_password_1_hashed:xauth-psk
your_vpn_username_2:your_vpn_password_2_hashed:xauth-psk

#####################


Passwords in this file are salted and hashed. This step can be done using e.g. the openssl utility:

# The output will be your_vpn_password_1_hashed
--- --- --- --- --- --- --- --- ---

openssl passwd -1 'your_vpn_password_1'

--- --- --- --- --- --- --- --- --- ---


Finally, restart services if you changed to a new PSK.
For add, edit or remove VPN users,
a restart is normally not required.

#####################

cd /home/hckao/openvpn-install
sudo ./openvpn-install.sh

Looks like OpenVPN is already installed.

What do you want to do?
   1) Add a new user
   2) Revoke an existing user
   3) Remove OpenVPN
   4) Exit
Select an option [1-4]:



#####################


sudo service ipsec restart ||
sudo systemctl restart ipsec

sudo service xl2tpd restart ||
sudo systemctl restart xl2tpd

sudo nano /etc/ipsec.secrets (這個是金鑰)
sudo nano /etc/ppp/chap-secrets
sudo nano /etc/ipsec.d/passwd

sudo cat /etc/ipsec.secrets  (這個是金鑰)
sudo cat /etc/ppp/chap-secrets
sudo cat /etc/ipsec.d/passwd

#####################

