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:08] – 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 28: | Line 28: | ||
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 | + | In fact, since your private key is encrypted, you need to type the password |
- | + | ||
- | 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 | + | |
==== Setup 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 once. Keeping the decrypted key (or the password) in memory is considered safer than letting the key file un-encrypted. | ||
+ | |||
+ | === 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] ~/ | ||
+ | |||
+ | * 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 | ||
+ | </ | ||
+ | |||
+ | This will start '' | ||
sshkey.txt · Last modified: 2022/08/05 11:20 by admin