OpenVPN - Server Not starting

Scripts to manage certificates or generate config files
Post Reply
PedroSwan
OpenVpn Newbie
Posts: 5
Joined: Sun Jun 30, 2019 6:42 am

OpenVPN - Server Not starting

Post by PedroSwan » Sun Jul 07, 2019 3:19 pm

I have two virtual machines one for the Certificates and OpenVPN on the other.

Used the a digital ocean guide, with every stop being correctly followed

I have gotten to the point of

Code: Select all

sudo systemctl start openvpn@server
and get the following error

Code: Select all

Job for openvpn@server.service failed because the control process exited with error code.
See "systemctl status openvpn@server.service" and "journalctl -xe" for details.
Within the vars/log/syslog

Code: Select all

Jul  7 16:15:55 VPN-Server systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Jul  7 16:15:55 VPN-Server systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jul  7 16:15:55 VPN-Server systemd[1]: Failed to start OpenVPN connection to server.
Jul  7 16:16:01 VPN-Server systemd[1]: openvpn@server.service: Service hold-off time over, scheduling restart.
Jul  7 16:16:01 VPN-Server systemd[1]: openvpn@server.service: Scheduled restart job, restart counter is at 812.
Jul  7 16:16:01 VPN-Server systemd[1]: Stopped OpenVPN connection to server.
Jul  7 16:16:01 VPN-Server systemd[1]: Starting OpenVPN connection to server...
Jul  7 16:16:01 VPN-Server ovpn-server[3820]: WARNING: cannot stat file 'server.key': No such file or directory (errno=2)
Jul  7 16:16:01 VPN-Server ovpn-server[3820]: Options error: --key fails with 'server.key': No such file or directory (errno=2)
Jul  7 16:16:01 VPN-Server ovpn-server[3820]: Options error: Please correct these errors.
Jul  7 16:16:01 VPN-Server ovpn-server[3820]: Use --help for more information.
Jul  7 16:16:01 VPN-Server systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Jul  7 16:16:01 VPN-Server systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jul  7 16:16:01 VPN-Server systemd[1]: Failed to start OpenVPN connection to server.
Jul  7 16:16:06 VPN-Server systemd[1]: openvpn@server.service: Service hold-off time over, scheduling restart.
Jul  7 16:16:06 VPN-Server systemd[1]: openvpn@server.service: Scheduled restart job, restart counter is at 813.
Jul  7 16:16:06 VPN-Server systemd[1]: Stopped OpenVPN connection to server.
Jul  7 16:16:06 VPN-Server systemd[1]: Starting OpenVPN connection to server...
Jul  7 16:16:06 VPN-Server ovpn-server[3823]: WARNING: cannot stat file 'server.key': No such file or directory (errno=2)
Jul  7 16:16:06 VPN-Server ovpn-server[3823]: Options error: --key fails with 'server.key': No such file or directory (errno=2)
Jul  7 16:16:06 VPN-Server ovpn-server[3823]: Options error: Please correct these errors.
Jul  7 16:16:06 VPN-Server ovpn-server[3823]: Use --help for more information.
Jul  7 16:16:06 VPN-Server systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Jul  7 16:16:06 VPN-Server systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jul  7 16:16:06 VPN-Server systemd[1]: Failed to start OpenVPN connection to server.

This is the relevant section in my server.conf

Code: Select all

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
Files within the /etc/openvpn/ folder

Code: Select all

ca.crt  client  dh.pem  server  server.conf  server.crt  ta.key  update-resolv-conf
I'm pulling my hair out....

I have tried adding the full paths in the server.conf

Code: Select all

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key  # This file should be kept secret
But still nothing..... HELP PLEASE

User avatar
imjebran
OpenVPN Power User
Posts: 69
Joined: Tue Jul 03, 2012 10:38 am

Re: OpenVPN - Server Not starting

Post by imjebran » Tue Jul 09, 2019 9:44 am

Code: Select all

 key /etc/openvpn/server.key
server.key file is missing, This file doesn't exist in the OpenVPN directory, kindly check carefully, the file need with complete extension.

Post Reply