[scponly] sftp-server not found

Christopher Barry christopher.barry at qlogic.com
Fri May 29 13:50:36 EDT 2009


Hi all,

I cannot connect for some reason, and I'm hoping someone can spot my error.

running scponly 4.8. on Ubuntu 8.10 server.
compiled as: ./configure --enable-winscp-compat --enable-sftp-logging-compat --enable-scp-compat --enable-chrooted-binary --with-sftp-server=/usr/lib/openssh/sftp-server

My message is inline with log dump.

[snip...]
May 29 13:17:21 test-sftp sshd[7782]: subsystem request for sftp
May 29 13:17:21 test-sftp sshd[7782]: debug1: subsystem: exec() /usr/lib/openssh/sftp-server -l VERBOSE -f AUTH

note above: sftp-server path from /etc/ssh/sshd_config

May 29 13:17:21 test-sftp sshd[7783]: debug3: mm_consolekit_register entering
May 29 13:17:21 test-sftp sshd[7783]: debug3: Copy environment: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
May 29 13:17:21 test-sftp sshd[7783]: debug3: Copy environment: LANG=en_US.UTF-8
May 29 13:17:21 test-sftp sshd[7783]: debug3: channel 0: close_fds r -1 w -1 e -1 c -1
May 29 13:17:21 test-sftp scponly[7783]: chrooted binary in place, will chroot()
May 29 13:17:21 test-sftp scponly[7783]: 3 arguments in total.
May 29 13:17:21 test-sftp scponly[7783]: ^Iarg 0 is scponlyc
May 29 13:17:21 test-sftp scponly[7783]: ^Iarg 1 is -c
May 29 13:17:21 test-sftp scponly[7783]: ^Iarg 2 is /usr/lib/openssh/sftp-server -l VERBOSE -f AUTH

note above: scponly has identified the correct sftp-server path

May 29 13:17:21 test-sftp scponly[7783]: opened log at LOG_AUTHPRIV, opts 0x00000009
May 29 13:17:21 test-sftp scponly[7783]: determined USER is "tuser" from environment
May 29 13:17:21 test-sftp scponly[7783]: retrieved home directory of "/var/sftp/chroot_partners/tuser//home/tuser" for user "tuser"
May 29 13:17:21 test-sftp scponly[7783]: Setting homedir to /home/tuser
May 29 13:17:21 test-sftp scponly[7783]: chrooting to dir: "/var/sftp/chroot_partners/tuser"
May 29 13:17:21 test-sftp scponly[7783]: chdiring to dir: "/home/tuser"
May 29 13:17:21 test-sftp scponly[7783]: setting uid to 10001
May 29 13:17:21 test-sftp scponly[7783]: processing request: "/usr/lib/openssh/sftp-server -l VERBOSE -f AUTH"

note above: scponly is processing the path...

May 29 13:17:21 test-sftp scponly[7783]: Using getopt processing for cmd /usr/lib/sftp-server  (username: tuser(10001), IP/port: 10
.32.4.86 2574 22)

yet here the path has been altered.

May 29 13:17:21 test-sftp scponly[7783]: getopt processing returned 'l' (username: tuser(10001), IP/port: 10.32.4.86 2574 22)
May 29 13:17:21 test-sftp scponly[7783]: getopt processing returned 'f' (username: tuser(10001), IP/port: 10.32.4.86 2574 22)
May 29 13:17:21 test-sftp sshd[7780]: debug3: mm_request_receive entering
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "LOG_SFTP" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Found "USER" and setting it to "tuser"
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "SFTP_UMASK" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "SFTP_PERMIT_CHMOD" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "SFTP_PERMIT_CHOWN" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "SFTP_LOG_LEVEL" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Unable to find "SFTP_LOG_FACILITY" in the environment
May 29 13:17:21 test-sftp scponly[7783]: Environment contains "USER=tuser"
May 29 13:17:21 test-sftp scponly[7783]: running: /usr/lib/sftp-server -l VERBOSE -f AUTH (username: tuser(10001), IP/port: 10.32.4
.86 2574 22)
May 29 13:17:21 test-sftp scponly[7783]: about to exec "/usr/lib/sftp-server" (username: tuser(10001), IP/port: 10.32.4.86 2574 22)
May 29 13:17:21 test-sftp scponly[7783]: failed: /usr/lib/sftp-server -l VERBOSE -f AUTH with error No such file or directory(2)
(username: tuser(10001), IP/port: 10.32.4.86 2574 22)

...and finally, it cannot run the sftp-server. /usr/lib/sftp-server is a symlink to the real binary in the main system, but both are the same binary in the chrooted filesystem. At what point in the log above does the execution flip from the main filesystem to the chrooted binaries?

[snip...]


Thanks for all of your work,
-C




More information about the scponly mailing list