User Tools

Site Tools


sshkey

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
sshkey [2011/04/05 15:54] cangianisshkey [2011/04/05 16:04] cangiani
Line 4: Line 4:
  
 ===== Ssh without password from local workstation ===== ===== Ssh without password from local workstation =====
-==== Apple Os X & Linux ====+==== Generate the public/private ssh key pair  ==== 
 + 
 +Note that this doc applies only to Unix (Mac/Linux). There are similar things on window but they might not work //exactly// as described here. 
  
   * Login in your workstation and open a Terminal Windows (if you are using the Graphical interface)   * Login in your workstation and open a Terminal Windows (if you are using the Graphical interface)
Line 12: Line 15:
  
   * When the system ask a name for the file **id_dsa** just press enter   * When the system ask a name for the file **id_dsa** just press enter
 +
   * The system will ask your for a password. This is the password that is used to encrypt your private key file (id_dsa) so that, even if the file gets stolen, it cannot be used. Try to generate a [[strongpass|strong password]].   * The system will ask your for a password. This is the password that is used to encrypt your private key file (id_dsa) so that, even if the file gets stolen, it cannot be used. Try to generate a [[strongpass|strong password]].
  
-  * Now you have to append the content of your public key file ''~/.ssh/id_dsa.pub'' into the ''~/.ssh/authorized_keys'' on the machines where you want to be able to ssh into:+  * Now you have to append the content of your public key file ''~/.ssh/id_dsa.pub'' into the ''~/.ssh/authorized_keys'' on the machines where you want to be able to ssh into (e.g. if you are generating the key pair on your laptop, you might want to add the public key on the cluster lth.epfl.ch):
  
-  $ cat ~/.ssh/id_dsa.pub | ssh USERNAME@your.host.com 'cat - >> ~/.ssh/authorized_keys'+  $ cat ~/.ssh/id_dsa.pub | ssh USERNAME@lth.epfl.ch 'cat - >> ~/.ssh/authorized_keys'
  
   * In our cluster, all the machines have access to the same home directory. Therefore you can use standard local copy:   * In our cluster, all the machines have access to the same home directory. Therefore you can use standard local copy:
 +
   $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys   $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
  
-From now, every time you connet to a server, the server will recognize your workstation automatically (it read the ~/.ssh/authorized_keys file everytime you connect) and you can login without bothering with the password.... well almost! In fact, since your private key is encrypted, you need to type the password that can decrypt it before using it. So what ?+From now, every time you connet to a server, the server will recognize your workstation automatically (it read the ~/.ssh/authorized_keys file everytime you connect) and you can login without bothering with the password.... well almost! CuriousContinue reading.
  
-=== ssh-agent ===+==== Setup ssh-agent ====
  
-Ssh-agent is a program that keeps in memory your decrypted private ssh key and serves it to ssh when it is needed. In this way you only have to type the decryption password only onceKeeping the decrypted key in memory is considered safer than letting the key file un-encrypted. +In fact, since your private key is encrypted, you need to type the password that can decrypt it each time you want to use itSeems like we didn't gain anything till now
- +
-Let's set it up.+
  
 +Ssh-agent is a program that keeps in memory your decrypted private ssh key and serves it to ssh when it is needed. In this way you only have to type the decryption password only once. Keeping the decrypted key (or the password) in memory is considered safer than letting the key file un-encrypted.
  
 +Let's set it up.
  
-===== Ssh without password from laptop ===== 
  
  
sshkey.txt · Last modified: 2022/08/05 13:20 by admin