0

So I recently bought a Linux server (Debian GNU/Linux 7 (wheezy)). I only bought this server to use it as a VPN-Server. But it seems to be more complicated than I thought. I mean I don't want to learn Linux, I just want to set up OpenVPN that's it... Connecting to the server via SSH using Putty (from Windows 8.1) worked just fine. But even though I found a step by step tutorial for installing OpenVPN, I'm having a lot of trouble following it.

sudo apt-get install openvpn

I couldn't use sudo. So I just didn't use it. I'm on the root account though, in case that matters.

mkdir /home/root/openvpn

This command returned 'cannot create directory'. I googled it and used mkdir -p /home/root/openvpn instead, which returned nothing, so I assume it's fine.

vim /home/root/openvpn/client.ovpn

Returned that vim is not valid, so I tried apt-get install vim with success. Then then I tried the command again and I got stuck.. it took me forever to understand that I got myself into some weird edit mode... So I assume I have to "change filenames for keys and certificates of client.ovpn", but how.. and to what? Idk, I just skipped that for now.

openssl rsa -in /home/root/openvpn/spielprinzip.key -out /home/root/openvpn/spielprinzip_new.key -des3

for this I had to do apt-get install openssl. But I got an error because the key files do not exist. So how do I get/generate them?

Well, the last steps seem straight forward, but I obviously couldn't try them yet. And I'm really wondering where I get my account.cfg and x.opvn from, which I would need to establish the VPN connection.

  • This doesn't seem like an issue with SSH. Oh-- why is it erroring? There is no /home/root. You would have /root as your home directory. – Jared Allard Aug 6 '15 at 21:38
  • If you can’t get along with vim, take a look at nano. It does a lot less but is much more beginner-friendly. – Daniel B Aug 6 '15 at 21:49
0

For the directories not found: That's because there is no /home/root. Instead you have /root as your home directory.

Basically use your tutorial but replace everything having to do with /home/username to be /root. However, I suggest you don't use the root user for it all. It could be a security risk, make sure you drop the user perms used by the OpenVPN server to user & group nobody. This can be done in the server's OpenVPN config file server.conf

Config File Copy (in lieu of the cp in the first article below):

sudo gunzip -d /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz
sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf /etc/openvpn

Find the lines:

# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nogroup

Replace them with:

user nobody  
group nogroup

The tutorial you're using is not a very good one. It doesn't go into much detail, I recommend looking at the one I wrote: OpenVPN - The easy and secure way (Note: That's targeted for Arch Linux) but most of it's the same, or Digital Ocean's How to Install OpenVPN on Ubuntu.

  • Okay, I installed openvpn and easy-rsa via apt-get. But ´/usr/share/openvpn/examples/server.conf´ does not exist and thus the ´cp´ fails... The socond guid also failed because user openvpn does not exist . – Forivin Aug 7 '15 at 11:28
  • @Forivin Ah, that'd be because I linked the wrong article... Crap. Okay, so yea that file wouldn't exist in /usr/share/openvpn/examples/server.conf on a debian system – Jared Allard Aug 8 '15 at 3:35
  • See edit for the solution – Jared Allard Aug 8 '15 at 3:37
  • Okay, I followed your guide so far. I had to change a lot of things, for example I had to use /easy-rsa/2.0 instead of /easy-rsa... anyway, I just installed systemd and ran systemctl restart openvpn@server, but I get Failed to get D-Bus connection: Failed to connect to socket /run/systemd/private: No such file or directory ... What now? :( – Forivin Aug 8 '15 at 10:52
  • Is systemd the init? – Jared Allard Aug 9 '15 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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