sshd

How to enable passwordless logins to a server

  1. Enable root login with password on the server. To do so, you need to edit the file /etc/ssh/sshd_config.
    Modify the lines starting with "PermitRootLogin" like this:
    #PermitRootLogin prohibit-password
    PermitRootLogin yes
  2. Restart the sshd server:
    sudo systemctl restart sshd
  3. On the client, copy the public key files to the server with the ssh-copy-id command:
    ssh-copy-id root@server
  4. On the server, disable root login with password and enable root login with public key authentication:

How to start openvpn or ssh server under Ubuntu 16.04 and 18.04

OpenVPN
sudo systemctl start openvpn@client
The "client" is derived from the configuration file name (/etc/openvpn/client.conf). If your configuration file is server.conf, the command needs to be
sudo systemctl start openvpn@server
When you want the service to start up automatically during system boot, you issue:
sudo systemctl enable openvpn@server
Templated versus non-templated services