Page 1 of 1

running openvpn in the background Debian

Posted: Wed May 05, 2021 3:12 pm
by daft_dutch
Hi im trying to run openvpn as a service the debian way but i come across a problem.

Code: Select all

May  5 17:08:48 mole systemd[1]: Starting OpenVPN connection to login...
May  5 17:08:48 mole ovpn-login[11787]: Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/login.conf:1: <MYUSERNAME> (2.4.7)
May  5 17:08:48 mole ovpn-login[11787]: Use --help for more information.
May  5 17:08:48 mole systemd[1]: openvpn@login.service: Main process exited, code=exited, status=1/FAILURE
May  5 17:08:48 mole systemd[1]: openvpn@login.service: Failed with result 'exit-code'.
while the config runs fine when i use openvpn script.

Code: Select all

client
dev tun
proto udp
remote nl-ams.prod.surfshark.com 1194
resolv-retry infinite
remote-random
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ping 15
ping-restart 0
ping-timer-rem
reneg-sec 0

remote-cert-tls server

auth-user-pass /etc/openvpn/login.conf

#comp-lzo
verb 3
pull
fast-io
cipher AES-256-CBC

auth SHA512

<ca>
-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----
</ca>
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----

-----END OpenVPN Static key V1-----
</tls-auth>
in /etc/openvpn/login.conf i have to lines the username and the password,

can some one help me?

Re: running openvpn in the background Debian

Posted: Wed May 05, 2021 4:26 pm
by TinCanTech
Don't use the name login.conf because your idiotic service wrapper is trying to start it as an openvpn process.

Re: running openvpn in the background Debian

Posted: Wed May 05, 2021 9:57 pm
by 300000
if you want to run openvpn automatic from reboot just add on system so it will start openvpn . let open terminal and type

" sudo systemctl enable openvpn@login.conf "

only need to do one time and forget it will do job for you.

Re: running openvpn in the background Debian

Posted: Wed May 05, 2021 10:09 pm
by TinCanTech
300000 wrote:
Wed May 05, 2021 9:57 pm
if you want to run openvpn automatic from reboot just add on system so it will start openvpn . let open terminal and type

" sudo systemctl enable openvpn@login.conf "

only need to do one time and forget it will do job for you.
I think it should be disable ..

And that will not work anyway because it is not systemd at fault but Debian service wrapper ..

Re: running openvpn in the background Debian

Posted: Fri May 07, 2021 10:14 am
by daft_dutch
it works. I renamed login,conf to login.

then a stange thing happend it wanted a client.conf so badly it died it did not exist.
so i made a symlink to my ovpn conf file.
now it works