set ssh key for ssh connection ubuntu 18.04 code example Example: ubuntu add public key to server ssh-copy-id -i ~/.ssh/id_rsa.pub user@server