DEV Community

[Comment from a deleted post]
Collapse
 
mrrcollins profile image
Ryan Collins • Edited

Good write-up, but two changes:

  • ssh will complain about permissions on .ssh. The permissions of the directory should be 700 (dwrx------)
  • authorized_keys needs to be 640 (-rw-r-----)

Also, you don't have to restart sshd after copying the ssh keys, authorized_keys will start working immediately.

If you are using a Linux host, ssh-copy-id will take care of copying your public key to a remote host and appending it to the authorized_keys file. (Under macOS you can install it with brew install ssh-copy-id).

Again, great write-up, using ssh-keys is paramount to good security practices.