How to do a SSH authentication without password
go back to Main Page, Computational Resources, Information & Help, Chemistry & More, Linux & Unix
Introduction
Each time you want to connect to an external server you need your password... You're tired? I propose a method to avoid having to enter password.
To do this we will use the == SSH key == type RSA or DSA.
Principle is simple:
- You create an encrypted SSH key on the local computer (local)
- You send a part of it to the distant server (for example kimik2)
Create a SSH encrypted key on the local machine
The key is composed of two file: id_dsa and id_dsa.pub.
- id_dsa is the private key!!! DO NOT DIVULGE !!!
- id_dsa.pub is the public key.
First, check if you have or not this key. It is located in the .ssh directory
/home/user_local/.ssh/
If there is already this two file, go to the last part of this tutotial, else let's create this files. It is very easy via the keygen function:
ssh-keygen -t dsa
The computer ask you: Enter file in which to save the key (/home/user_local/.ssh/id_dsa): I let this part empty Then the computer ask you for a passphrase. Of course you have to put one for your security.
If everything is OK, the 'echo' is: Your identification has been saved in /home/user_local/.ssh/id_dsa. Your public key has been saved in /home/user_local/.ssh/id_dsa.pub. The key fingerprint is: 7b:53:c3:.................:e8:6c:bb user@local The key's randomart image is: +--[ DSA 1024]----+ | | | | | | | . . | | S ++.o | | . +o+++ | | . +oo +=.| | . .+o=. | | .E+...| +-----------------+
--construction--