About SSH Connections by Private and Public Keys

To create an SSH access to a remote server by private and public keys, append the content of a public key to ~/.ssh/authorized_keys on the remote server.

Note that for all this to work, you must set the file permissions for ~/.ssh to 700 and the file permissions for ~/.ssh/authorized_keys to 600.

The local directory ~/.ssh/ should also have permissions 700 and the files inside should have permissions 600.

Tips and Tricks Dev Ops Security SSH