using ssh without password

Arno Lehmann al at its-lehmann.de
Tue Mar 8 13:51:44 CET 2005


Do you want to run your checks as root or as nagios user?

I'll point you to some output below:

vivek sharma sharma wrote:
...
> and running ssh with -v option gives the following output
> ########################################
> ssh -v 203.187.192.44
> OpenSSH_3.5p1, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Applying options for *
> debug1: Rhosts Authentication disabled, originating port will not be 
> trusted.
> debug1: ssh_connect: needpriv 0
> debug1: Connecting to 203.187.192.44 [203.187.192.44] port 22.
> debug1: Connection established.
Below, you see that you connect as root
> debug1: identity file /root/.ssh/identity type 0
> debug1: identity file /root/.ssh/id_rsa type 1
> debug1: identity file /root/..ssh/id_dsa type 2
> debug1: Remote protocol version 1.99, remote software version OpenSSH_2.9p2
> debug1: match: OpenSSH_2.9p2 pat OpenSSH_2.*,OpenSSH_3.0*,OpenSSH_3.1*
> debug1: Enabling compatibility mode for protocol 2.0
> debug1: Local version string SSH-2.0-OpenSSH_3.5p1
> debug1: SSH2_MSG_KEXINIT sent
> debug1: SSH2_MSG_KEXINIT received
> debug1: kex: server->client aes128-cbc hmac-md5 none
> debug1: kex: client->server aes128-cbc hmac-md5 none
> debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
> debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
> debug1: dh_gen_key: priv key bits set: 114/256
> debug1: bits set: 1018/2049
> debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
> debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
> debug1: Host '203.187.192.44' is known and matches the RSA host key.
> debug1: Found key in /root/.ssh/known_hosts:1
> debug1: bits set: 1040/2049
> debug1: ssh_rsa_verify: signature correct
> debug1: kex_derive_keys
> debug1: newkeys: mode 1
> debug1: SSH2_MSG_NEWKEYS sent
> debug1: waiting for SSH2_MSG_NEWKEYS
> debug1: newkeys: mode 0
> debug1: SSH2_MSG_NEWKEYS received
> debug1: done: ssh_kex2.
> debug1: send SSH2_MSG_SERVICE_REQUEST
> debug1: service_accept: ssh-userauth
> debug1: got SSH2_MSG_SERVICE_ACCEPT
> debug1: authentications that can continue: 
> publickey,password,keyboard-interactive
> debug1: next auth method to try is publickey
> debug1: try pubkey: /root/.ssh/id_rsa
> debug1: authentications that can continue: 
> publickey,password,keyboard-interactive
> debug1: try pubkey: /root/.ssh/id_dsa
> debug1: authentications that can continue: 
> publickey,password,keyboard-interactive
> debug1: next auth method to try is keyboard-interactive
> debug1: authentications that can continue: 
> publickey,password,keyboard-interactive
> debug1: next auth method to try is password
> Then the password prmpt comes for client host.

Probably you allowed the nagios users keys?

> ####################################################################
> 
> Any suggestions on this.

Read the manual :-P

Arno

> Thanks Vivek
> 
> 
> 
> On Tue, 08 Mar 2005 Arno Lehmann wrote :
>  >You should check the system-wide ssh and sshd configurations.
>  >If you are not the administrator of the server you want to log into, 
> ask them how to setup ssh to work without passphrase.
>  >Verify that the file names for authorized keys are correct.
>  >You should run ssh with the -v switch, then it tells you what it does, 
> including which keys it uses and what the server thinks about those.
>  >You should have a look at the server's logfile..
>  >You can also run the server with debug output.
>  >
>  >Arno
>  >
>  >vivek sharma sharma wrote:
>  >>Hi all,
>  >>      I am trying make ssh work without password so as to use 
> push_ssh in nagios .for this
>  >>
>  >>I have done the following things:
>  >>1.)On nagios host :
>  >>ssh-keygen -t rsa
>  >>
>  >>no passphrase entered
>  >>
>  >>2.)created a .ssh dir. in the client host with 600 permissions
>  >>  In this host created file by vi editor
>  >>    vi authorizedkeys2
>  >>and pasted the contents of id_rsa.pub file from nagios host
>  >>
>  >>3.)then if i try to do ssh from nagios host to the client host still 
> it asks for a password.
>  >>
>  >>Dont know whats wrong now..
>  >>Plz suggest
>  >>
>  >>Thanks
>  >>Vivek
>  >>
>  >>
>  >>
>  >>
>  >><http://clients.rediff.com/signature/track_sig.asp>
>  >
>  >-- IT-Service Lehmann                    al at its-lehmann.de
>  >Arno Lehmann                  http://www.its-lehmann.de
> 
> 
> 
> <http://clients.rediff.com/signature/track_sig.asp>

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
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