1846548 Members
2267 Online
110256 Solutions
New Discussion

Re: Passwordless SSH

 
Venkat_11
Regular Advisor

Passwordless SSH

I want to enable SSH root login between two servers with out asking for password. Can anybody tell me the process to enable passworless login by using SSH.

Thanks
Venkat
11 REPLIES 11
Rajeev  Shukla
Honored Contributor

Re: Passwordless SSH

These are the steps you need to do on the source and destination server

1. Generate the key using ssh-keygen -t dsa
2. The above command will create a .ssh directory in the home directory of the user who runs the command (say root)
3. On the destination server create a directory called .ssh in the home directory of root
4. cd to ~root/.ssh directory on the source server and copy the content of id_dsa.pub file into the destination server in a file called authorized_keys
5. change the permission of the file authorized_keys to 640

I guess that should let you ssh without password
Bejoy C Alias
Respected Contributor

Re: Passwordless SSH

Remember that u should use a blank passphrase while creating the public/private key pair if u want to login to the second server without prompting for anything.
Be Always Joy ......
Arunvijai_4
Honored Contributor

Re: Passwordless SSH

Hi Venkat,

Here is a thread which contains method of doing it,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=851253

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Senthil Prabu.S_1
Trusted Contributor

Re: Passwordless SSH

Hi venkat,
plz find the attached doc which talks in brief about SSH passwordless authentication between two unix machines.


HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Senthil Prabu.S_1
Trusted Contributor

Re: Passwordless SSH

Hi venkat,
Also check following my posts on this
topic.

links;
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972682
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972682

HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
Khashru
Valued Contributor

Re: Passwordless SSH

please find the attach document.
PeterWolfe
Respected Contributor

Re: Passwordless SSH

Starting with 11.23 December 05, there
is a new tool called csshsetup, which helps
to automate the manual key distribution steps.
You can simply:
csshsetup remotehost
to do a one way key exhange (add your key to the
remote host). You can do:
csshsetup -r remotehost
to do a bidirectional or round-robin key exchange
in order to have passwordless ssh in either direction.
The -f option can be used to extend
this to additional hosts. For example, to set
up ssh keys across all the nodes of a Serviceguard cluster:
csshsetup -r -f
where memberlist contains the list of cluster members.
csshsetup will ask you for each remote system's password
one time in order to do the key exchange (using ssh itself).
Alexander Skwar
Frequent Advisor

Re: Passwordless SSH

Instead of using a blank passphrase for your SSH key, you might want to consider using a SSH key agent. PuTTY and OpenSSH (and HP-UX Secure Shell, I assume) offer such a thing.

It basically works this way:
You start the key agent and load your SSH key into it. You're then asked ONCE for the passphrase of the ssh key. After that, if you connect to a host, the key agent will then present this "pre-authenticated" key and the system will let you login without asking you for an additional password. This only works if you're using SSH interactively, though.

To add a key to the OpenSSH keyagent, run "ssh-add". For PuTTY, double click on your .ppk file.
Tvs
Regular Advisor

Re: Passwordless SSH


Hi
sh-keygen -t dsa , generates SSH-2 DSA key pairs.Depending on which protocol and algorithm you use, securely copy or append the public keyfile (~/.ssh/identity.pub, ~/.ssh/id_dsa.pub, or ~/.ssh/id_rsa.pub) from the ssh-client system to the ssh-server system and name it ~/.ssh/authorized_keys. You can append the file using the cat command

regards

tvs
Alexander Skwar
Frequent Advisor

Re: Passwordless SSH

BTW: There's also a "ssh-copyid" command which will copy the SSH key to the remote server and append it to authorized_keys.
Venkat_11
Regular Advisor

Re: Passwordless SSH

Thanks for the all the poeple who ever responded.