Unix Shell - SSH Return Codes

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > SSH Return Codes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SSH Return Codes
Tairone

2006-10-31, 7:25 pm

Hi all,

I wrote a script to verify if the comand ssh is correctly configured in
some servers, and I'm having problems with return codes. I previously
made a copy of the public keys files from a central server to the file
authorized_keys of all servers in my network, so everything is ok.

When conect via ssh to the server "serv10" from the central server, the
server does not prompt for password. I type the comand "exit 0" and
again in the central server "echo $?". It returns the correct code: 0.
But in the following script, which I wrote for making the verification,
the behavior is diferent.

#!/bin/ksh

ssh -o ConnectTimeout=3D30 -o NumberOfPasswordPrompts=3D0 -o
StrictHostKeyChecking=3Dno serv10 << ENDSSH
exit 0
ENDSSH

echo $?

Surprisingly, the ssh is returning the code 255 when I execute this
script. This happens only for this and other 2 servers.

Can anyone help me?
=20
Thanks in advance.
=20
Tairone Nunes Magalh=E3es
Telemar - Brazil

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com