sshkey
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sshkey [2011/04/05 16:08] – cangiani | sshkey [2022/08/05 13:20] (current) – admin | ||
---|---|---|---|
Line 12: | Line 12: | ||
* Execute this command | * Execute this command | ||
- | $ ssh-keygen -t dsa | + | $ ssh-keygen -t ed25519 |
- | * When the system ask a name for the file **id_dsa** just press enter | + | * When the system ask a name for the file **id_ed25519**, 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_ed25519) so, 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 '' |
- | $ cat ~/ | + | $ ssh-copy-id <USERNAME>@lth.epfl.ch |
* 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 >> ~/ | + | $ cat ~/.ssh/id_ed25519.pub >> ~/ |
- | From now, every time you connet | + | From now, every time you connect |
- | 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.1302012493.txt.gz · Last modified: 2011/04/05 16:08 by cangiani