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.

Share:
57,471

Related videos on Youtube

n00b
Author by

n00b

Updated on September 18, 2022

Comments

  • n00b
    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
    n00b almost 11 years
    Thanks Eric for your help. Can I put more than 10 config files in /etc/openvpn/ ?
  • Eric Carvalho
    Eric Carvalho almost 11 years
    As 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
    n00b almost 11 years
    Eric: 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
    Eric Carvalho almost 11 years
    Yes, sudo update-rc.d openvpn enable.
  • n00b
    n00b almost 11 years
    Thanks Eric for your help. Would you mind looking at the question indicated by the following link: askubuntu.com/questions/303203/…
  • Anto
    Anto over 10 years
    Hello @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 prevent supervisor from auto-starting) ? Or is it just for OpenVPN ?
  • Kaos
    Kaos over 9 years
    +1 for sudo service openvpn start <vpn-name>
  • Nek
    Nek almost 4 years
    update-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
    Displayname71 over 2 years
    None 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