RE: FW: SSH/SFTP rc problem in Solaris.



This is different than what you first posted -- it doesn't have an ls -l at
the end, so it exits with a different error code.
___
Sent with SnapperMail
www.snappermail.com

...... Original Message .......
On Tue, 9 May 2006 08:22:09 +0200 "Dony Pierre" <Pierre.Dony@xxxxxx> wrote:
Hi Patrick,

When I do the test on a RedHat, I get a rc 1 !.

[donypie@linprd03 ~]$ cat a.sftp
get tuut.test

[donypie@linprd03 ~]$ sftp -b a.sftp localhost
donypie@localhost's password:
sftp> get tuut.test
Couldn't stat remote file: No such file or directory
File "/home/donypie/tuut.test" not found.
[donypie@linprd03 ~]$ echo $?
1
[donypie@linprd03 ~]$


But I have received news from Sun concerning this problem and they said
that :

Openssh sftp has changed in release 3.6p1, and *this* is why we are
seeing different behaviour e.g. on a Linux distribution which bundles
a sufficiently recent OpenSSH suite.

These newer sftp binaries will indeed exit with a nonzero status when
one of the batched subcommands did not succeed as requested, and of
course they will still do so when they encounter a protocol-level error.


I hope they will implement these new features in SSH Sun as soon as
possible.


Thanks everybody.
Pierre.


-----Original Message-----
From: Patrick Morris [mailto:pmorris@xxxxxxxxxxxxxxxxxx]
Sent: vendredi 5 mai 2006 21:27
To: secureshell@xxxxxxxxxxxxxxxxx
Subject: RE: FW: SSH/SFTP rc problem in Solaris.

Just tried this on a Red Hat box (EL4). I get a return code of 0 for
the same commands.

We have a SSH return code problem when we use SSH in batch in
Solaris.
We haven't this problem on RedHat.

bash-2.05$ cat a.sftp
ls -l
pwd
get b.txt
ls -l
bash-2.05$ sftp -b a.sftp scnsys11
Connecting to scnsys11...
Password:
sftp> ls -l
drwxr-xr-x 0 9108 10 512 Apr 21 11:15 .
drwxr-xr-x 0 0 1 512 Apr 3 14:23 ..
-rw------- 0 9108 10 2387 Apr 21 11:18
..bash_history
-rw------- 0 9108 10 240 Mar 28 16:19 .sh_history
drwx------ 0 9108 10 512 Mar 22 17:11 .ssh
drwx------ 0 9108 10 512 Mar 22 16:00 .ssh2
-rwxrwxrwx 0 9108 10 26 Mar 29 15:22 a.sftp
-rwxrwxrwx 0 9108 10 0 Mar 28 15:28 a.txt
-rw------- 0 9108 10 1021424 Mar 22 17:07 core
sftp> pwd
Remote working directory: /export/home/huysego
sftp> get b.txt
Couldn't stat remote file: No such file or directory File
"/export/home/huysego/b.txt" not found.
sftp> ls -l
drwxr-xr-x 0 9108 10 512 Apr 21 11:15 .
drwxr-xr-x 0 0 1 512 Apr 3 14:23 ..
-rw------- 0 9108 10 2387 Apr 21 11:18
..bash_history
-rw------- 0 9108 10 240 Mar 28 16:19 .sh_history
drwx------ 0 9108 10 512 Mar 22 17:11 .ssh
drwx------ 0 9108 10 512 Mar 22 16:00 .ssh2
-rwxrwxrwx 0 9108 10 26 Mar 29 15:22 a.sftp
-rwxrwxrwx 0 9108 10 0 Mar 28 15:28 a.txt
-rw------- 0 9108 10 1021424 Mar 22 17:07 core
sftp>
bash-2.05$ echo $?
0

************************************************************************
********************************************************************
** As you can see in this example, sftp gives a rc = 0. If you try
the
same
on RedHat, you will receive a rc not equal to 0.



-----------------------------------------
Visit our website! http://ww



Relevant Pages

  • RE: FW: SSH/SFTP rc problem in Solaris.
    ... sftp> get tuut.test ... bash-2.05$ cat a.sftp ... Couldn't stat remote file: No such file or directory File ... necessarily reflect NBB viewpoints, particularly when the content ...
    (SSH)
  • Sftp Port
    ... Who here has installed sftp from the FreeBSD port and had success? ... fetch: pub/sftp/.tar.gz: cannot get remote modification time ... *** Error code 1 ...
    (FreeBSD-Security)
  • 5.2.1 buildworld problems
    ... For some reason bulidworld is failing to build. ... It exits on trying to ... build sftp. ...
    (freebsd-current)