in reply to Connection test : Net::SSH::Perl : $ssh->login - detecting failure

I dont think this is the way. $ssh->login doesnt seem to return anything I can use. The 'new' method returns an object, can I do anything with this once Ive called a login ? Stuck.

Originally I used IO::SOCKET to check if port 22 was even there. But that didn't check if login worked or not. Since then I've been wrapping $ssh->new and $ssh->login inside eval which seemed to do the trick. I even logged which servers it failed on so I could check later on. You might want to give that a try. It seems to work pretty good.
  • Comment on Re: Connection test : Net::SSH::Perl : $ssh->login - detecting failure

Replies are listed 'Best First'.
Re^2: Connection test : Net::SSH::Perl : $ssh->login - detecting failure
by jxh (Acolyte) on Feb 18, 2006 at 12:03 UTC
    Hi, thanks for the response - Ill give the eval a go and post back. My subtle difference between the two posts though : This one will test ssh using the 'key files' ( ie no password supplied ) whereas the Net:SSH::Perl question ( node_id=531107 ) I am using to check I have valid username / password combinations. ( Scenario : should my key files become regenerated / otherwise break - I need to know I can still use the password to log in an correct it ) I think I can apply your suggestion to both problems however.