Work continued. As I changed DCC to a service and adjusted my "worklog", I will continue with number 64 (3 additional rows been added as stated above to change the symlink for dcc to real service setup, thanks to Davide).
I now set up OpenVPN access to the server only. So I used an OpenVPN setup script to be very pragmatic and just adjusted some values:
64 cd /tmp
65 wget
https://github.com/Angristan/OpenVPN-install/archive/master.zip
66 unzip master.zip
67 cd OpenVPN-install-master
68 chmod +x openvpn-install.sh
69 ./openvpn-install.sh
I left the detected IP address (however recognized, that this IP address is used as remote address value in client config, which I changed later on to the hostname) left port and protocol as given, I chose resolvers DNS servers, as I also removed that line later on pushing DNS servers as I don't need a road warrior setup but just a server access setup, selected the fastest options for data channel, DH and RSA (as I just want to block out script kiddies etc. from accessing or trying to access SSH or GUI, but it's no rocket science done here), left the client name and let the script set up everything for me.
Welcome to the secure OpenVPN installer (github.com/Angristan/OpenVPN-install)
I need to ask you a few questions before starting the setup
You can leave the default options and just press enter if you are ok with them
I need to know the IPv4 address of the network interface you want OpenVPN listening to.
If your server is running behind a NAT, (e.g. LowEndSpirit, Scaleway) leave the IP address as it is. (local/private IP)
Otherwise, it should be your public IPv4 address.
IP address: xxx.xxx.xxx.xxx
What port do you want for OpenVPN?
Port: 1194
What protocol do you want for OpenVPN?
Unless UDP is blocked, you should not use TCP (unnecessarily slower)
Protocol [UDP/TCP]: UDP
What DNS do you want to use with the VPN?
1) Current system resolvers (from /etc/resolv.conf)
2) Cloudflare (Anycast: worldwide)
3) Quad9 (Anycast: worldwide)
4) FDN (France)
5) DNS.WATCH (Germany)
6) OpenDNS (Anycast: worldwide)
7) Google (Anycast: worldwide)
8) Yandex Basic (Russia)
9) AdGuard DNS (Russia)
DNS [1-8]: 1
See
https://github.com/Angristan/OpenVPN-install#encryption to learn more about
the encryption in OpenVPN and the choices I made in this script.
Please note that all the choices proposed are secure (to a different degree)
and are still viable to date, unlike some default OpenVPN options
Choose which cipher you want to use for the data channel:
1) AES-128-CBC (fastest and sufficiently secure for everyone, recommended)
2) AES-192-CBC
3) AES-256-CBC
Alternatives to AES, use them only if you know what you're doing.
They are relatively slower but as secure as AES.
4) CAMELLIA-128-CBC
5) CAMELLIA-192-CBC
6) CAMELLIA-256-CBC
7) SEED-CBC
Cipher [1-7]: 1
Choose what size of Diffie-Hellman key you want to use:
1) 2048 bits (fastest)
2) 3072 bits (recommended, best compromise)
3) 4096 bits (most secure)
DH key size [1-3]: 1
Choose what size of RSA key you want to use:
1) 2048 bits (fastest)
2) 3072 bits (recommended, best compromise)
3) 4096 bits (most secure)
RSA key size [1-3]: 1
Finally, tell me a name for the client certificate and configuration
Please, use one word only, no special characters
Client name: client
Okay, that was all I needed. We are ready to setup your OpenVPN server now
Press any key to continue...
...
Finished!
Your client config is available at /root/client.ovpn
If you want to add more clients, you simply need to run this script another time!
70 vi /etc/openvpn/server.conf
I removed the both push lines
push "dhcp-option DNS 127.0.0.1"
push "redirect-gateway def1 bypass-dhcp"
because DHCP makes no sense and I don't need a VPN DNS for administrating my server and for sure I don't want all traffic going through the server
71 service openvpn restart
After changing the values, I restarted OpenVPN server
72 vi /root/client.ovpn
I changed the IP address to the hostname and removed the line
setenv opt block-outside-dns
for the same reason as above (this would prevent my local DNS server settings from working).
Then I downloaded the client.ovpn to my systems, added it to their config and tested the VPN connection.
73 ufw delete allow 8006
74 ufw allow from 10.8.0.2 to any port 8006
75 ufw delete allow ssh
76 ufw allow from 10.8.0.2 to any port ssh
I removed the old firewall rules allowing full internet access to port 8006 (first tested with GUI to prevent locking myself out from ssh before I have proofed concept) and ssh (after successful testing).
Now my last topic is to set up a backup script.