However, you have to prevent the shell from asking you the password every
time you log in. Here comes a short tutorial how to set up ssh accordingly.
How to ssh from A to B without providing a password (in 3 steps):
I. generate a identity file on A
II. copy it over to B
III. add this file to the list of authorized login
I. on A:
you just need to press return after all questions asked (3 times)
- using ssh version 1
ssh-keygen
Generating public/private rsa1 key pair.
Enter file in which to save the key (/home/tru/.ssh/identity): (press return)
Enter passphrase (empty for no passphrase): (press return)
Enter same passphrase again: (press return)
Your identification has been saved in /home/tru/.ssh/identity.
Your public key has been saved in /home/tru/.ssh/identity.pub.
- using ssh2 (default on our machines redhat 7.1)
There are two crypt algorithms RSA and DSA, do it for both!
I think one is enough, just is case...
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/tru/.ssh/id_rsa): (press return)
Created directory '/home/tru/.ssh'.
Enter passphrase (empty for no passphrase): (press return)
Enter same passphrase again: (press return)
Your identification has been saved in /home/tru/.ssh/id_rsa.
Your public key has been saved in /home/tru/.ssh/id_rsa.pub.
ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/tru/.ssh/id_dsa): (press return)
Enter passphrase (empty for no passphrase): (press return)
Enter same passphrase again: (press return)
Your identification has been saved in /home/tru/.ssh/id_dsa.
Your public key has been saved in /home/tru/.ssh/id_dsa.pub.
ls -l
total 24
-rw---- 1 tru Genopole 668 Sep 26 18:37 id_dsa
-rw-r-r- 1 tru Genopole 614 Sep 26 18:37 id_dsa.pub
-rw---- 1 tru Genopole 539 Sep 26 18:41 identity
-rw-r-r- 1 tru Genopole 343 Sep 26 18:41 identity.pub
-rw---- 1 tru Genopole 883 Sep 26 18:36 id_rsa
-rw-r-r- 1 tru Genopole 234 Sep 26 18:36 id_rsa.pub
II. on A copying to B the required files
since you $HOME is nfs mounted you can use cp otherwise use scp
to transfer the *.pub files (ATTN don't overwrite existing ones)
cp id_dsa.pub id_dsa.pub-Bis
cp identity.pub identity.pub-Bis
cp id_rsa.pub id_rsa.pub-Bis
III. on B "authorize" login from A
since you $HOME is nfs mounted you can skip the ssh step :)
ssh to B
cd $HOME/.ssh (you might need to create it )
(on machine B)
cat identity.pub-Bis » authorized_keys
cat id_rsa.pub-Bis id_dsa.pub-Bis » authorized_keys2
That is it!
you can now ssh FROM A to B without password
If you have a shared nfs mounted $HOME, this means that you can freely
ssh from/to any workstation.