sshkey
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
sshkey [2007/01/30 14:23] – damir | sshkey [2011/04/05 16:04] – cangiani | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | You can connect to the servers using the SSH protocol | + | You can connect to the servers using the SSH protocol |
This behaviour can be used when you are using the Servers from the Epfl Network, but also when you connect to the server from outside the Epfl. | This behaviour can be used when you are using the Servers from the Epfl Network, but also when you connect to the server from outside the Epfl. | ||
- | ==== ssh without password from local workstation ==== | + | ===== Ssh without password from local workstation ===== |
+ | ==== Generate the public/ | ||
+ | |||
+ | Note that this doc applies only to Unix (Mac/ | ||
* 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) | ||
* Execute this command | * Execute this command | ||
- | $ sshkeygen | + | $ ssh-keygen |
* 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 | ||
- | * Do the same for the **id_dsa.pub** file | ||
- | * cd in your .ssh directory with | + | * 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]]. |
- | | + | |
- | | + | |
- | | + | |
- | 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. | + | $ cat ~/.ssh/id_dsa.pub >> ~/ |
+ | From now, every time you connet to a server, the server will recognize your workstation automatically (it read the ~/ | ||
- | ==== ssh without | + | ==== Setup ssh-agent ==== |
+ | |||
+ | 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 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. | ||
+ | |||
+ | |||
+ | |||
+ | ==== Apple Os X & Linux ==== | ||
- | === Apple Os X & Linux === | ||
- | | ||
* Open a terminal emulation window | * Open a terminal emulation window | ||
* Execute the command | * Execute the command | ||
- | | + | |
+ | | ||
* 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 | ||
Line 49: | Line 62: | ||
* Execute the command | * Execute the command | ||
| | ||
- | $ cat >> | + | $ cat >> |
* Now copy & paste with the mouse the key you have in the first window (something that start with sh-dss AAAAB3NzaC1k....) to the second window. | * Now copy & paste with the mouse the key you have in the first window (something that start with sh-dss AAAAB3NzaC1k....) to the second window. | ||
- | * press the **Ctrl+d** key combination to close the **cat** command | + | * press the "**Ctrl+d**" |
- | * Try to connect to **lth.epfl.ch**, | + | * Try to connect to **lth.epfl.ch**, |
- | + | ||
- | + |
sshkey.txt · Last modified: 2022/08/05 13:20 by admin