ssh exit codes

From: Ian Pellew (ian.pellew@orange.be)
Date: 01/28/02


From: ian.pellew@orange.be (Ian Pellew)
Date: 28 Jan 2002 08:14:50 -0800

Guys;

Newbie to ssh and 2 Q's

1. What are the exit code/return value(s) of ssh ?
   Cannot seem to find any mention of this.
   EG
   RET=$(/usr/local/bin/ssh -2 cacsuser@${REMOTEHOST_SRC} "ls")
   (Not my code)
   This sometimes fails and I was wondering if anything can be
   gleamed from the shells `$?`

2. Any ideas / suggestions on how to test this script's
   RET=$(/usr/local/bin/ssh -2 cacsuser@${REMOTEHOST_SRC} "ls").
   My problem is, its a gone away third party shell script,
   that I have modified (Added teh above to a retry loop) and
   would like to test in a NON live environment.
   Is there some test option or service I can take advantage of?
   I have no ideas on how to set ssh up or if I could use the LIVE
   service in a test mode or something.

The script is currently live, accept the `RET=$(/usr/local/bin/ssh -2
cacsuser@${REMOTEHOST_SRC} "ls")` sometimes fails to connect. I think
the coder uses the `ls` just to check the connection, maybe there is a
better way, ssping !!

Regards
Ian



Relevant Pages

  • ssh pub-key login failes randomly
    ... I have a very strange problem: Since a few days SSH public-key logins from ... everything always worked great and I didn't update OpenSSH / OpenSSL ... Login fails and prompts for password. ...
    (comp.security.ssh)
  • R: sshd open to everyone if PAM auth sufficient
    ... >]configuration file for ssh. ... If it fails, then it is ignored, and the other items ... how can I request to PAM the following logical ... I want my users to autenticate to Unix passwords or fallback to Samba ...
    (comp.security.ssh)
  • Re: exec and pipe
    ... should be passed to procmail via ssh. ... involved fails, or if the program exits with non-zero status. ... Closing a pipe also waits for the process ...
    (perl.beginners)
  • Re: ssh brute force attacks
    ... http://aplawrence.com/Security/sshloginattack.html "SSH Login Attacks" ... things like not allowing passwords, but still have the lockout modules ... If for some reason it does, ... If that fails, you aren't supposed to be logging in with ...
    (comp.os.linux.misc)
  • RE: Corporate SSH for IRIX
    ... not fail if I use the IP address in the ssh command. ... It only fails when I ... ssh server and nsswitch is set to files then dns. ... > some machines we can even finish the make install. ...
    (SSH)