How to disable OpenVPN from autostarting at boot-up or reboot?
57,471
You have two options:
Run:
sudo update-rc.d openvpn disable
Then you'll have to run
sudo service openvpn start
to manually start the VPN.Or edit the file /etc/default/openvpn
sudo gedit /etc/default/openvpn
And uncomment the line:
#AUTOSTART="none"
So it looks like:
AUTOSTART="none"
Then you'll have to run
sudo service openvpn start <vpn-name>
to manually start the VPN.<vpn-name>
is the config file name without.conf
.
Related videos on Youtube
Author by
n00b
Updated on September 18, 2022Comments
-
n00b over 1 year
I am using Ubuntu 12.04.2 LTS, 64-bit, OpenVPN client 2.3.1
How do I prevent OpenVPN from autostarting at boot-up or reboot?
-
n00b almost 11 yearsAccording to OpenVPN's website (openvpn.net/index.php/download/community-downloads.html), it is recommended to use the current stable release. Specifically the download link for 2.3.1 is repos.openvpn.net/repos/apt/precise-stable/… What I did was to right-click the URL and was given the option to save it locally or opened with "Ubuntu Software Center". I chose the latter and installed it with the help of "Ubuntu Software Center".
-
-
n00b almost 11 yearsThanks Eric for your help. Can I put more than 10 config files in /etc/openvpn/ ?
-
Eric Carvalho almost 11 yearsAs many as you want. I don't know about its limits, but I think you could have a reasonably high number of config files.
-
n00b almost 11 yearsEric: If I choose Option 1, ie. to run sudo update-rc.d openvpn disable, if I wish to re-enable autostart, do I use the command: sudo update-rc.d openvpn enable ?
-
Eric Carvalho almost 11 yearsYes,
sudo update-rc.d openvpn enable
. -
n00b almost 11 yearsThanks Eric for your help. Would you mind looking at the question indicated by the following link: askubuntu.com/questions/303203/…
-
Anto over 10 yearsHello @EricCarvalho: thanks for the answer. Is it some sort of standard ? Can I add the
AUTOSTART="none"
to another service file (I'd like to preventsupervisor
from auto-starting) ? Or is it just for OpenVPN ? -
Kaos over 9 years+1 for
sudo service openvpn start <vpn-name>
-
Nek almost 4 yearsupdate-rc.d is init.d related, the new way to process is using systemd.
systemctl is-enabled openvpn@vpn-name
to learn if it's enabled,systemctl disable openvpn@vpn-name
to disable on startup. -
Displayname71 over 2 yearsNone of this works for me. I always have an /usr/sbin/openvpn running after bootup that I have to manually kill, but it comes back on reboot