SEARCH
TOOLBOX
LANGUAGES
Ssh

Ssh

From Hugme.org

Jump to: navigation, search

Keyswap

This will allow you to use keys to log into a device.

Generate your keys

$ ssh-keygen -t rsa
  • this will generate 2 files, id_rsa and id_rsa.pub. These are your public and private files. Make sure the permissions to this file are correct:
-rw-------  1 hugme  hugme  1675 Jun 23 09:52 id_rsa
-rw-r--r--  1 hugme  hugme   398 Jun 23 09:52 id_rsa.pub
  • Now link the keys to the correct name
$ ln -s id_rsa identity
$ ln -s id_rsa.pub identity.pub

Swap keys

add your public key to the server you are logging into

  • Create the folder on the machine you are connecting to
$ ssh [destination] "mkdir .ssh"
  • give it your public key
$ cat identity.pub | ssh [destinationp] "cat - > .ssh/authorized_keys"