I have been following the instructions posted here:


and have been able to connect to a VPN server (NordVPN) easily.

My Pi is currently set up with OSMC and so I had to do this using ssh from my laptop using Putty.

I would like to know if there is a way to keep the setting of the VPN connection permanent, so that when I turn the Pi off and start it up later the VPN connection is maintained.

I don’t want to have to connect via a laptop each time to setup the VPN.

  • 1
    You can make a script that logs in on boot up.
    – Ingo
    Jul 17, 2019 at 10:27
  • That would be great. Is there a tutorial I can find online? I am quite new to the Pi and it’s inner workings. Jul 17, 2019 at 10:29
  • 1
    your question has nothing to do with the Pi and its inner workings ... it is a linux question
    – jsotola
    Jul 17, 2019 at 14:50
  • @jsotola Apologies, I didn't realise it was a Linux issue. Reviewing this site's help: "Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for the Raspberry Pi" If figured this would be a good place to start. The answer provided met my needs, if necessary please feel free to move this to the Linux SE. Jul 18, 2019 at 23:50
  • @KeaganAllan, no need to apologize ... i was simply guiding you towards investigating your problem in the Linux realm
    – jsotola
    Jul 19, 2019 at 0:15

1 Answer 1


We don't know anything about your log in commands but you can put this commands into a shell script. This is basic bash programming and you will find millions of tutorials how to do it.

If you have made the script and you have tested it running from the command line then just make a systemd Unit file to start this script one time on boot up. You will also find many examples here on this site. If you have found an example you should use Type=oneshot together with RemainAfterExit=yes in the Unit file.

If you run in trouble with your efforts then just give me feedback in a comment to this answer.

  • 1
    Thank you. I will have a look online and give it a go Jul 17, 2019 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.