SSH Public & Private key generation
RSA and DSA keys are deprecated and may not be supported on all Mac and Linux versions.
bbThe recommendation at time of writing is to use ecdsa 521[sic] for a balance between security and compatibility
#create public and private key pair
ssh-keygen -f key-filename -t ecdsa -b 521
#copy the public key to the $home/.ssh directory of the remote server
scp key-filename.pub host.contoso.com:~/.ssh/.
#The public key must be added to the ~/.ssh/authorized_keys file on the remote host
user@host.contoso.com$ ssh-copy-id -i key-filename.pub user@host.contoso.com
## As an alternative to ssh-copy-id the key can be appended to the authorized_keys file
cat key-filename.pub >> ~/.ssh/authorized_keys
Key File Permissions
700 drwx------ ~/.ssh : SSH-Folder
644 -rw-r----- ~/.ssh/key-filename.pub : public key
600 -rw------- ~/.ssh/key-filename : private key
755 drwxr-xr-x ~/ : home folder (at most)
« Go back
Powered by Help Desk Software HESK, in partnership with SysAid Technologies