SSH and SSH-Keygen

From Colettapedia
Jump to navigation Jump to search
  • It really is as simple as you remember it
  1. Type "ssh-keygen"
    • ssh-keygen -f name_of_key
    • You can "ssh-keygen -p -f old_private_key_file" to change the passphrase
  2. scp ./ssh/id_rsa.pub username@hostname:~/.ssh/
  3. On the host, `cp ~/.ssh/id_rsa.pub authorized_keys`, or append id_rsa.pub to that file if it already exists.
  • Making it so that you don't have to enter in your username every time
    1. Go to ~/.ssh/
    2. Edit the config file
    3. Transfer the id_rsa.pub file to the server ~/.ssh/ and rename it to "authorized_keys", or append the entry to the authorized_keys file that's already there.
  • client-side file: ~/.ssh/config
  • IMPORTANT: private keys cannot be group or world readable or the server will ignore them, AND YOU WILL BE LOCKED OUT OF SSH-ING IN!
Host lgchrm*
  User colettace

Host the_name_i_like
  User ccoletta-x
  HostName server.url.whizbang.com
  IdentityFile /full/path/to/local_key
  Port 2222