Fedora 17 Installing and running OpenVPN from console (root user ...

possibledisastrousSecurity

Dec 9, 2013 (3 years and 7 months ago)

93 views

Fedora 17
Installing and running OpenVPN from console (root user)
1) openvpn installation:
#
yum install openvpn
2) Copy nsurname.key, nsurname.crt and ca.crt to /
etc/openvpn/keys/
directory
3) copy nsurname.ovpn to
/etc/openvpn
directory
4) #
chkconfig --level 2345 openvpn on
5**) Preparing automatic script:
#
ln -s /lib/systemd/system/openvpn\@.service \
/etc/systemd/system/multi-user.target.wants/openvpn\@nsurname.service
6**) Starting demon
#
systemctl start
openvpn@nsurname.conf.service
7) Running in a „screen” session
#
screen
#
openvpn --script-security 2 –config /etc/openvpn/nsurname.conf
Ctrl+a and next "d" (detach)
8) When we want to kill the connection we attach to screen by:
#
screen -x
if there are more screen sessions open, we use:
#
screen -x ID
where ID is number of our screen taken from '
screen -ls
'
(**) Probably there is no way to run openvpn as a daemon, if private key is password protected. Alternative

solution is presented in 7) and 8)
More information can be found:

http://fedoraproject.org/wiki/Openvpn#Setting_up_a_Linux_OpenVPN_client


Configuring and running OpenVPN with Network Manager
1) "NetworkManager VPN plugin for OpenVPN"
(installation need ROOT privileges!!)
Applications -> Add/Remove Software
In search/filter box write „openvpn”, from the list of found matches
choose "NetworkManager VPN plugin for OpenVPN" and click „Apply”
2) Copy nsurname.key, nsurname.crt and ca.crt to $HOME/.cert directory.
Files should have permissions set to write and read for owner only (600 for
example)
3) In Activities -> Applications -> System Settings -> Network menu, a new
connection must be created of the type „OpenVPN”:

Gateway: 192.68.51.225
Authentication: "Certificates (TLS)"
User Certificate: "$HOME/.cert/nsurname.cert"
Ca Certificate: "$HOME/.cert/ca.cert"
Private Key: "$HOME/.cert/nsurname.key"
Private Key Password: *****************

at the Advanced tab option „Use LZO data compression" must be checked on
4) To establish connection, just switch it to „On” in the Network Manager