openvpn doesn't find conf files outside /etc/openvpn
Posted: Sat Feb 27, 2021 1:48 pm
I want to run openvpn as a systemd service.
I downloaded my openvpn configuration files from my VPN provider.
I have one configuration file per VPN server.
I put one of those files inside /etc/openvpn to be recognized my openvpn.
Let's say the file is called /etc/openvpn/server534.conf.
Then I run
In "server534.conf", I modified this line:
to:
Because in the future I would like to start the service at login without manually inserting username and password.
However, as can be seen by the error logs in "journalctl -xe", the file "/home/myname/vpncredentials.txt" does not exist for openvpn started in this way. A "cat /home/myname/vpncredentials.txt" shows the file correctly.
If I move "vpncredentials.txt" inside /etc/openvpn and modify the configuration file accordingly, it works.
Why openvn does not recognize configuration files outside of /etc/openvpn?
How can I keep my configuration file outside /etc/openvpn?
I downloaded my openvpn configuration files from my VPN provider.
I have one configuration file per VPN server.
I put one of those files inside /etc/openvpn to be recognized my openvpn.
Let's say the file is called /etc/openvpn/server534.conf.
Then I run
Code: Select all
sudo systemctl start openvpn-client@server534
Code: Select all
auth-user-pass
Code: Select all
auth-user-pass /home/myname/vpncredentials.txt
However, as can be seen by the error logs in "journalctl -xe", the file "/home/myname/vpncredentials.txt" does not exist for openvpn started in this way. A "cat /home/myname/vpncredentials.txt" shows the file correctly.
If I move "vpncredentials.txt" inside /etc/openvpn and modify the configuration file accordingly, it works.
Why openvn does not recognize configuration files outside of /etc/openvpn?
How can I keep my configuration file outside /etc/openvpn?