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



The second "ls -l" command successfully completes. Therefore the return code
is zero.

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.



Relevant Pages

  • RE: FW: SSH/SFTP rc problem in Solaris.
    ... same commands. ... We haven't this problem on RedHat. ... bash-2.05$ sftp -b a.sftp scnsys11 ... sftp> pwd ...
    (SSH)
  • Re: SFTP in batch- password?
    ... apparently the syntax is ... $ sftp "-Bbatch.txt" 'username'@'node' ... I don't know if the pwd should be the first line of batch.txt ... or put in with the username somehow ...
    (comp.os.vms)
  • Re: SFTPing a File From stdin
    ... Well, assuming the server really supports sftp, as suggested by your ... I haven't verified this though - see diff 2 below if you just don't ...
    (comp.security.ssh)
  • 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)
  • chroot on redhat 9
    ... I'm looking for a tutorial to install chroot on Redhat 9. ... able to sftp or scp into a jailed environment. ...
    (linux.redhat)