how to setup ssh with public-key authentication on ubuntu code example Example: ubuntu add public key to server ssh-copy-id -i ~/.ssh/id_rsa.pub user@server