Operating System - HP-UX
1752799 Members
6166 Online
108789 Solutions
New Discussion юеВ

Re: Need to add new server for passwordless ssh login

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Need to add new server for passwordless ssh login

Hi,

I need to setup a passwordless login from server A to B.
Both the servers are running SSH daemons and has already been setup for passwordless
connection for other servers.

I just need to add one additional server for passwordless ssh login.
Can someone suggest how to do it ?

Thanks,
Shiv
5 REPLIES 5
Tingli
Esteemed Contributor
Solution

Re: Need to add new server for passwordless ssh login

It is the same as you did with A and B.

Assuming the new system is C,
1. login to C, make a directory .ssh in your home directory.

2. run ssh-keygen -t rsa, respond all the request with return key.

3. cd to .ssh and look for file id_rsa_pub.

4. Login to A, cd to .ssh, and append the id_rsa_pub file from C to file authorized_keys in A.

5. Do the same thing in B.
Raj D.
Honored Contributor

Re: Need to add new server for passwordless ssh login

Shivkumar,

You have to generate the ssh key with ssh_keygen in server A , and to copy the file to server B with name authorized_keys under ~home3/.ssh/ directory:


check this out:
Transparent ssh i.e ssh with no password:
http://www.tek-tips.com/faqs.cfm?fid=5600


Also,

http://forums13.itrc.hp.com/service/forums/questionanswer.do?&threadId=1364024

Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: Need to add new server for passwordless ssh login

There are numerous posts on this topic,
Hope this document helps:
Check out:
http://forums13.itrc.hp.com/service/forums/questionanswer.do?&threadId=952222

Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Mel Burslan
Honored Contributor

Re: Need to add new server for passwordless ssh login

A simple search of the forums should give you at least 10 of the same or very similar questions, asked in the last 6 months I am sure. But for what it is worth:

login to server A as username which will initiate the passwordless login and run

/opt/ssh/bin/ssh-keygen -t {rsa or dsa here}

you need to hit enter 3 times (may be different for you how many times you have to hit it) until you return to the shell prompt, accepting no pass phrase option for your key pair. One caveat here: if you have a previously recorded id_rsa recorded in the default location, you will write over it, which will make your previous password-less login setups and cause them to fail.

If you have the previously created public and private key pair available under ~username/.ssh, you may skip this step. As a matter of fact, you *SHOULD* skip this step to keep the existing authentication pairs alive.

Then you need to copy the .pub portion of the key pair to server B using any mothod you lie, probably utilizing a password one last time:

ftp serverB
username
password
ftp> bin
ftp> put id_rsa.pub /tmp/id_rsa.pub

Then you need to login to the server B as the same user as you are in server A, again using your password and run:

cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys

this should do it. If it is not working, make sure the private part of the key pair has no permissions for anyone but the owner.

HTH
________________________________
UNIX because I majored in cryptology...
OldSchool
Honored Contributor

Re: Need to add new server for passwordless ssh login

just be careful with the permissions on the .ssh directory and it's parent. incorrect permissions will cause ssh to ignore the key or treat it as invalid.