2013-08-22 03:34:11 +02:00
|
|
|
# To generate an SSH key:
|
2013-08-11 21:37:11 +02:00
|
|
|
ssh-keygen -t rsa
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To generate a 4096-bit SSH key:
|
2013-08-11 21:37:11 +02:00
|
|
|
ssh-keygen -t rsa -b 4096
|
|
|
|
|
2013-08-29 05:06:43 +02:00
|
|
|
# To update a passphrase on a key
|
|
|
|
ssh-keygen -p -P old_passphrase -N new_passphrase -f /path/to/keyfile
|
|
|
|
|
|
|
|
# To remove a passphrase on a key
|
|
|
|
ssh-keygen -p -P old_passphrase -N '' -f /path/to/keyfile
|
|
|
|
|
|
|
|
# To generate a 4048 bit RSA key with a passphase and comment containing the user and hostname
|
|
|
|
ssh-keygen -t rsa -b 4048 -C "$USER@$HOSTNAME" -P passphrase
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To copy a key to a remote host:
|
2013-08-11 21:37:11 +02:00
|
|
|
ssh-copy-id username@host
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To copy a key to a remote host on a non-standard port:
|
2013-08-11 21:37:11 +02:00
|
|
|
ssh-copy-id username@host -p 2222
|