Configuring a new server

1. Add a new user:

adduser username 

2. Add this user to sudoers group:

usermod -aG sudo username

3. Switch to this user:

su - username

4. Open the ssh configuration file:

vim /etc/ssh/sshd_config

5. In the line PermitRootLogin yes replace the word Yes with the word No:

PermitRootLogin no

6. In the line #PasswordAuthentication yes replace the word Yes with the word No and uncomment this line:

PasswordAuthentication no

7. Add your to autorized_keys (run it from the client):

ssh-copy-id username@remote_host

8. Save the file and restart the service:

sudo service ssh restart

9. Install curl:

sudo apt update && sudo apt install curl -y 

10. Download openvpn-installer:

curl -O

11. Add execution permission:

chmod +x

12. Then run it:

sudo ./

13. Create ssh "bookmark" (run it from the client):

echo "Host dev
     User username
     Port 22
 " >> ~/.ssh/config

14. Copy *.ovpn files to your PC (run it from the client):

scp dev:~/*.ovpn ~/Downloads/