The root cause appears to be the way sshd parses it's configuration file and subsequently processes exit codes from subprocesses (such as sftp-server). When the sftp server exits , it passes either a signal or exit code back to sshd, and then sshd should in turn drop the connection. sshd does not drop the connection. However, when we switch LogLevel from INFO to DEBUG in sshd_config, when sftp exits, sshd now exits properly. The only difference here, is the processing thread within sshd's subsystem shell. We even verified different versions of the sftp-server subsystem, both with the same results.
Can't replicate: [djm@sakura djm]$ sftp -b testbatch localhost Connecting to localhost... root@localhost's password: sftp> get /bin/ls /tmp/foo Fetching /bin/ls to /tmp/foo sftp> ls /tmp/foo /tmp/foo sftp> put /tmp/foo /tmp/bar Uploading /tmp/foo to /tmp/bar Uploading /tmp/foo to /tmp/bar sftp> ls -l /tmp/bar -rwxr-xr-x 0 0 0 178028 Nov 19 06:42 /tmp/bar sftp> sftp> [djm@sakura djm]$ ps ax | grep sftp 3917 p2 I+ 0:00.01 grep sftp [djm@sakura djm]$ cat testbatch get /bin/ls /tmp/foo ls /tmp/foo put /tmp/foo /tmp/bar ls -l /tmp/bar
Created attachment 502 [details] sshd_config file try changing the LogLevel from DEBUG3 to INFO or AUTH, it appears that sftp doesn't exit (this test was conducted from a sun client to an AIX sftp-server.
Can't replicate either (AIX 5.2 ML1), with LogLevel either INFO or DEBUG3. Tried both a local and remote (Solaris 8) client. What version and maintenance level of AIX do you have? Can you replicate with both client and server on the AIX box? For that matter, can you replicate with the current version of OpenSSH? Can you attach (note: create attachment, not paste into comments) the debug output from sftp (eg "sftp -vvv -b testbatch localhost"). $ echo `uname` `oslevel -r` AIX 5200-01 $ ssh -V OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090702f grep LogLevel /usr/local/etc/sshd_config LogLevel INFO $ sftp -b testbatch localhost Connecting to localhost... dtucker@localhost's password: sftp> get /bin/ls /tmp/foo sftp> ls /tmp/foo /tmp/foo sftp> put /tmp/foo /tmp/bar Uploading /tmp/foo to /tmp/bar sftp> ls -l /tmp/bar -rwxr-xr-x 0 500 1 22488 Nov 19 11:00 /tmp/bar sftp> $ ps -eaf |grep sftp dtucker 2610 10118 1 11:00:27 pts/0 0:00 grep sftp
No followup = closed bug.
Mass change of RESOLVED bugs to CLOSED