Use the -i
flag to specify a particular key
From the documentation:
If the filename does not end in .pub this is added.
So, you don’t copy your private key, it’s alright. But add it nonetheless if you want to feel extra secured.
To disable root ssh login, add this to /etc/sshd_config
:
To force ssh key login only, add this to /etc/sshd_config
:
Finally, restart ssh: