Differences between revisions 3 and 4
Revision 3 as of 2013-08-27 06:28:54
Size: 746
Editor: ArtAmezcua
Comment:
Revision 4 as of 2013-08-27 06:34:35
Size: 1455
Editor: ArtAmezcua
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 1. On local machine, run <<BR>><<BR>>{{{ssh-keygen -t rsa}}}
Do ssh-keygen on the SOURCE host.
 2. Write to file, probably not the same id_rsa you currently have
 3. On SOURCE machine, now should see two files : id_rsa_stuff, id_rsa_stuff.pub
 4. Go to DESTINATION host. Copy key contents of SOURCE id_rsa_stuff.pub into DESTINATION's authorized_keys file.
 5. make sure DESTINATION authorized_keys is permission 600
 6. on SOURCE machine, source the agent - source ~/.ssh-agent (check that .ssh-agent is the filename using ls -a command).
 7. on SOURCE machine, do ssh-add .ssh/id_rsa_stuff
 8. Try it. ssh user@DESTINATION
 9. Should just work with no password.

If you are creating this public-private key to make ssh not prompt for a password when you ssh from one JSOC machine to another, then stop at step 5. The local and remote machines are one in the same if you are creating these keys for this purpose. These first 5 steps will also allow you to issue CVS commands without having to enter a password.

 1. On the local machine, run <<BR>><<BR>>{{{ssh-keygen -t rsa}}} This will create a public-private key pair (one file will be created to contain the public key, and one will be created to contain the private key).
 1. You get to choose the names of the files into which the keys are saved. You can select the default filename if you wish (if the file already exists, it will be overwritten). If not, and you choose a filename of <filename>, then the private key will be stored in <your home directory/.ssh/<filename>, and the private key will be stored in <your home directory/.ssh/<filename>.pub
 1.
 1. Go to DESTINATION host. Copy key contents of SOURCE id_rsa_stuff.pub into DESTINATION's authorized_keys file.
 1. make sure DESTINATION authorized_keys is permission 600
 1. on SOURCE machine, source the agent - source ~/.ssh-agent (check that .ssh-agent is the filename using ls -a command).
 1. on SOURCE machine, do ssh-add .ssh/id_rsa_stuff
 1. Try it. ssh user@DESTINATION
 1. Should just work with no password.

Some quick notes on the sequence for installing ssh keys.

If you are creating this public-private key to make ssh not prompt for a password when you ssh from one JSOC machine to another, then stop at step 5. The local and remote machines are one in the same if you are creating these keys for this purpose. These first 5 steps will also allow you to issue CVS commands without having to enter a password.

  1. On the local machine, run

    ssh-keygen -t rsa This will create a public-private key pair (one file will be created to contain the public key, and one will be created to contain the private key).

  2. You get to choose the names of the files into which the keys are saved. You can select the default filename if you wish (if the file already exists, it will be overwritten). If not, and you choose a filename of <filename>, then the private key will be stored in <your home directory/.ssh/<filename>, and the private key will be stored in <your home directory/.ssh/<filename>.pub

  3. Go to DESTINATION host. Copy key contents of SOURCE id_rsa_stuff.pub into DESTINATION's authorized_keys file.
  4. make sure DESTINATION authorized_keys is permission 600
  5. on SOURCE machine, source the agent - source ~/.ssh-agent (check that .ssh-agent is the filename using ls -a command).
  6. on SOURCE machine, do ssh-add .ssh/id_rsa_stuff
  7. Try it. ssh user@DESTINATION
  8. Should just work with no password.

JsocWiki: SSHKeyNotes (last edited 2013-08-27 07:02:14 by ArtAmezcua)