sshkey
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
sshkey [2011/04/05 14:05] – cangiani | sshkey [2019/11/06 10:00] – admin | ||
---|---|---|---|
Line 16: | Line 16: | ||
* 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 strong password. |
* Now you have to append the content of your public key file '' | * Now you have to append the content of your public key file '' | ||
Line 27: | Line 27: | ||
From now, every time you connet to a server, the server will recognize your workstation automatically (it read the ~/ | From now, every time you connet to a server, the server will recognize your workstation automatically (it read the ~/ | ||
+ | |||
+ | In fact, since your private key is encrypted, you need to type the password to decrypt it each time you want to use it. Seems like we have just replaced the "enter remote machine password" | ||
==== Setup ssh-agent ==== | ==== Setup ssh-agent ==== | ||
- | In fact, since your private key is encrypted, | + | Ssh-agent is a program that keeps in memory |
+ | |||
+ | === On desktop sessions === | ||
+ | All modern desktop environment (os X, Gnome, KDE), do take care automatically the ssh key decryption business and you don't have to do anything. Yahoo! | ||
+ | |||
+ | === On console === | ||
+ | If you are not on a full desktop environment (e.g. if you ssh to a machine from where you want to connect to [several] another machines), then you have to setup the ssh-agent business by hand. | ||
+ | |||
+ | The two (actually three) steps are | ||
+ | * launch | ||
+ | |||
+ | $ eval `ssh-agent -s` | ||
+ | |||
+ | * ask '' | ||
+ | |||
+ | $ ssh-add [-t time_in_seconds] ~/.ssh/ | ||
+ | |||
+ | * before logging out you have to remember to kill the ssh-agent: | ||
+ | |||
+ | $ ssh-agent -k | ||
+ | |||
+ | Since this is quite cumbersome, I suggest to add the following to your '' | ||
+ | |||
+ | < | ||
+ | # only for interactive shell | ||
+ | if [ " | ||
+ | # run ssh agent if not already running | ||
+ | SSHAGENT=/ | ||
+ | if [ -z " | ||
+ | eval `$SSHAGENT -s` | ||
+ | alias ssh=' | ||
+ | trap " | ||
+ | fi | ||
+ | fi | ||
+ | </ | ||
- | Ssh-agent | + | This will start '' |
- | Let's set it up. |
sshkey.txt · Last modified: 2022/08/05 11:20 by admin