ssh with key files

Prev  
 Next

This is an old revision of the document!


back  
 next

ssh with key files

ssh-keygen

The sudo ssh-key command is used to create ssh key pairs

ssh-keygen

ssh-keygen default

  • ssh-keygen creates a SSH key pair. The defaults are:
    • home directory /homeuser/.ssh
    • public key /home/user/.ssh/id_rsa
    • private key /home/user/.ssh/id_rsa.pub

ssh-keygen with filename

  • ssh-keygen -f .ssh/key-with-password creates a SSH key with non-default name and location. The defaults are:
    • public key /home/user/.ssh/key-with-password
    • private key /home/user/.ssh/key-with-password.pub

Warning

**During further SSH key pair generation, if you do not specify a unique file name, you are prompted for permission to overwrite the existing id_rsa and id_rsa.pub files. If you overwrite the existing id_rsa and id_rsa.pub files, you must then replace the old public key with the new one on ALL of the SSH servers that have your old public key. **

Once you have generated the keys, they are stored in the /user/home/.ssh/ directory with the following permissions:

  • Private key - 600
  • Public key - 644

Using ssh-keygen and sharing for key-based authentication in Linux

back  
 next
/storage/data/attic/tech_notes/ssh.1709951063.txt.gz · Last modified: 2026-07-25 Sat wk30 18:48
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International