Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting up ssh keys for a set of machines 2

Status
Not open for further replies.

msatishkumar143

Programmer
Sep 3, 2005
2
US
Hi all,

I am new to the world of ssh, I want to setup passpharseless ssh keys for a user say "abab".

# from any machine the users should be able to run something like

$ ssh -i /home/abab/.ssh/identity-abab abab@host?.bruce "hostname"

Thanks
satish
 
It just happens that I have just finished a documentation for my company on ssh password. It may not be spot on what you need but it could be a good starting place.

#########################################################
There are two servers, Server1 and Server2. (this works between two AIX servers, two Linux server or between Linux and AIX servers)

Server1 & 2 want to be able to ssh from one server to another without asking for passwords.


On Server1 when logged in as the user you wish to use (this example we will use “user1” id)

Run the following command

#ssh-keygen –t rsa

You will get the following

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):

Press enter to take the default settings

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Press enter to blank out the password request for the “passphrase”

Your identification has been saved in /home/user1/.ssh/id_rsa.
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
The key fingerprint is:
blah:1b:42:ba:blah:ec:41:blah:01:blah:73:83:99998:8a:fb:99 user1@fileserver

So now you have created your rsa keys.
Now what you need to do is create a autorized_keys2 file on Server2, do this by doing the following, (make sure you are in the “/” directory before running)

scp /home/user1/.ssh/id_rsa.pub 1??.??.??.??:/home/sysadmtg/.ssh/authorized_keys2

You will get asked to enter in the password for the id you are using for Server2

user1@1??.??.??.??'s password:

After entering the correct password you should able to ssh or sftp to Server2 from Server1 without being asked for a password.

To be able to go from Server2 to Server1 in the same way and assuming you already have the two rsa file (if not just run the “ssh-keygen” command from the home directory) run the following command

scp /home/user1/.ssh/id_rsa.pub 1??.??.?.??.??:/home/user1/.ssh/authorized_keys2

You should be able to go between Server1 and Server2 without asking for passwords.
##########################################

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top