0

I connect to openvpn with this command

openvpn --config ovpn file address

when I try it for the first time it's ok and connect correctly but when I disconnect it using ctrl+c it wont connect again and this error will show up although I use correct username and password.

SIGTERM[soft,auth-failure] received, process exiting

When I restart my computer I can connect with openvpn perfectly. how can I connect without restart my computer I think my disconnection way is wrong and it doesn't kill all openvpn process.

2 Answers 2

3

If you have installed network-manager-openvpn, you can connect to a VPN stored in Network Manager by

nmcli con up id ConnectionName

And disconnect from the VPN by the command

nmcli con down id ConnectionName

Where ConnectionName is the id of your VPN in network manager. You can list all the ids by the command

nmcli con

Source

4
  • This says how to connect to a saved VPN. User is using command line just fine to connect. This answer does not solve the problem of auth failure upon attempt to reconnect. Additionally, without installing additional plugins, OpenVPN connections are not saved in network manager.
    – user323419
    Feb 26, 2016 at 14:24
  • This method works for me. Feb 26, 2016 at 14:26
  • Then you have installed the network-manager-openvpn package. If this user has not installed that, and s/he is connecting (as s/he has stated) through the explicit openvpn file.conf method, your stated method will not work to solve the authentication failure. I manage my own OpenVPN server, this is what I do.
    – user323419
    Feb 26, 2016 at 14:37
  • Thanks. I have edited your additional info into my answer. I also have my own OpenVPN server. Feb 26, 2016 at 14:38
1

Unfortunately, connecting explicitly through command like that has some issues, specifically with killing the process. In some systems, killing the connection through a Ctrl+C does not fully terminate the connection. I always suggest that clients connecting to my OpenVPN server use the system service method.

First, you will want to move your configuration file to the main OpenVPN config directory:

sudo mv /path/to/config /etc/openvpn

Then, you will need to make sure that OpenVPN is configured to autostart your connection:

sudo YOUR_TEXT_EDITOR_HERE /etc/default/openvpn

Find the commented line that says:

#AUTOSTART="all"

Uncomment the line (remove the # at the beginning) and replace the word "all" with the name of your .conf file without the .conf extension.

Now, to start and stop the connection:

sudo service openvpn start
sudo service openvpn stop

Using the system service method will ensure the connections are properly established and terminated each time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .