ssh without password not happening

Andreas Ericsson ae at op5.se
Mon Mar 7 19:28:12 CET 2005


vivek sharma sharma wrote:
> Hi, I am trying to make ssh work without password so as i can use
> check_by_ssh further
> 
> So for this what i have done is:
> 
> 1.) ssh-keygen -t rsa1 ssh-keygen -t dsa ssh-keygen -t rsa
> 

One of them is enough. dsa is the recommended nowadays.

> 2.) Copied the files generated into ~/.ssh on remote machine
> 

Not all of them I hope. Only the .pub-files are required.

> The content of ~/.ssh/identity.pub on the local machine goes in the
> file ~/.ssh/authorized_keys on the remote machines.
> 
> The content of the ~/.ssh/id_dsa.pub on the local machine goes in
> /.ssh/authorized_keys on the remote machines.
> 
> Likewise, the content of the ~/.ssh/id_rsa.pub on the local machine
> is appended to ~/.ssh/authorized_keys on the remote machines
> 

Did you chmod 700 ~/.ssh on both hosts?
Did you chmod 600 ~/.ssh/* on both hosts?

> 3.) Priming the agent: ssh_info_file=~/.ssh-agent-info-`hostname` 
> ssh-agent >$ssh_info_file chmod 600 $ssh_info_file source
> $ssh_info_file ssh-add ~/.ssh/identity ssh-add ~/.ssh/id_dsa ssh-add
> ~/.ssh/id_rsa
> 

This is really only necessary if you've chosen a passphrase for the 
keys, which you don't have to. If you ever decide to reboot your nagios 
server you'll have to log in and restart the agent once more.

> 4.) Attaching the agent:
> 
> . ~/.ssh-agent-info-`hostname`
> 
> After doing all this when i try to ssh from nagios server m/c to
> client m/c where i ahve copied the keys still it asks for an
> password.
> 
> What may be missing in this . Plz suggest.
> 

tail -f /var/log/messages
on the remote host while trying a login from the nagios server.
If that fails, fire up a second instance of sshd with -vv (or was it 
-dd?) on a different port and try to connect to that using the key. The 
server will tell you what authentication methods it's trying, and why it 
doesn't succeed if it doesn't.

In case you don't see any pubkey authentication attempts, you might have 
to fix your /etc/ssh/ssh_config on the nagios server, or 
/etc/ssh/sshd_config on the remote host.

> Thanks. Vivek.
> 

Cheers.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list