Operating System - HP-UX
1822474 Members
2550 Online
109642 Solutions
New Discussion юеВ

Re: Setting up passwordless ssh login

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Setting up passwordless ssh login

Hi,

I want to setup passwordless ssh login. It should not ask the password even
the first time. How this will be achieved ?
While setting up passwordless ssh what is purpose of "known_hosts" ?

Thanks,
Shiv
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: Setting up passwordless ssh login

Hi Shiv:

This thread has a very good discussion of how to setup public keys in ssh:

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

The 'known_hosts' file contains the public host keys for all known hosts. The per-user version is maintained automatically. Thus, whenever a user connects from an unknown host, its key is added to the per-user file if you choose to acknowledge the fingerprint. If you don't, the connection can still be made, but you will be prompted the next time as if you had never connected.

See the manpages for 'sshd' and 'ssh' for more information.

Regards!

...JRF...

Sagar Sirdesai
Trusted Contributor

Re: Setting up passwordless ssh login

Say You want to login from Server A as root to Server B without password.

On Server A generate the public key using the ssh-keygen command by login as root

Then on Server B go to the home-dirof/.ssh
and append the public key string to authorised_keys file

Also in known_hosts file append the hostname of server A.

Sagar
Shivkumar
Super Advisor

Re: Setting up passwordless ssh login

So it means that we need to configure always 2 files "authorised_keys" and "known_hosts" for setting up passwordless login ?
Steven Schweda
Honored Contributor

Re: Setting up passwordless ssh login

> So it means that we need to configure
> always 2 files "authorised_keys" and
> "known_hosts" [...]

I wouldn't worry about "known_hosts". That
should be maintained automatically. You need
to deal with the actual key files,
"authorized_keys", and, perhaps, "identity".