Bug#482568: openssh-server: sshd disconnects client with exit 0 when symbolic links are met
Package: openssh-server
Version: 1:4.3p2-9etch2
Severity: important
-- System Information:
Debian Release: 4.0
APT prefers oldstable
APT policy: (500, 'oldstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages openssh-server depends on:
ii add 3.102 Add and remove users and groups
ii deb 1.5.11etch1 Debian configuration management sy
ii dpk 1.13.25 package maintenance system for Deb
ii lib 2.3.6.ds1-13etch5 GNU C Library: Shared libraries
ii lib 1.39+1.40-WIP-2006.11.14+dfsg-2etch1 common error description library
ii lib 1.4.4-7etch5 MIT Kerberos runtime libraries
ii lib 0.79-5 Pluggable Authentication Modules f
ii lib 0.79-5 Runtime support for the PAM librar
ii lib 0.79-5 Pluggable Authentication Modules l
ii lib 1.32-3 SELinux shared libraries
ii lib 0.9.8c-4etch3 SSL shared libraries
ii lib 7.6.dbs-13 Wietse Venema's TCP wrappers libra
ii ope 0.1.1 list of blacklisted OpenSSH RSA an
ii ope 1:4.3p2-9etch2 Secure shell client, an rlogin/rsh
ii zli 1:1.2.3-13 compression library - runtime
openssh-server recommends no packages.
-- debconf information:
ssh/vulnerable_host_keys:
ssh/new_config: true
* ssh/use_old_init_script: true
ssh/encrypted_host_key_but_no_keygen:
ssh/disable_cr_auth: false
-----------------------Detailed description-------------------------
When attempting to use a symbolic link using sftp protocol the client
is disconnected with exit 0.
This happens with FileZila (running on localhost) and WinSCP running
on remote machine.
Initially the error was observed because the entire home dirs where
symbolic-linked. This was removed and then explicit symbolinc links
were created inside the user home directory, pointing outside it. The
same behavior was observed.
- When using putty no errors occur using the same symbolic links.
- When the user is the root, no issues occur.
- When symbolic links are made inside the same directory (home) it works OK
----------- FileZila debug result on list home folder (success) ---------
Command: pwd
Response: Current directory is: "/home/gkakas"
Trace: CSftpControlSocket::ResetOperation(0)
Trace: CControlSocket::ResetOperation(0)
Trace: CSftpControlSocket::SendNextCommand(0)
Trace: CSftpControlSocket::ListSend(0)
Trace: state = 1
Trace: CSftpControlSocket::ResetOperation(0)
Trace: CControlSocket::ResetOperation(0)
Status: Directory listing successful
-----------------------------------------------
Following the symbolic link:
lrwxrwxrwx 1 root root 17 2008-05-23 12:07 myfilespace -> /userstore/gkakas
and the target:
drwxrwxrwx 10 gkakas gkakas 4096 2008-05-23 01:18 gkakas
gives a failure:
---------------------------------------------------------
Command: cd "/home/gkakas/myfilespace/"
Response: New directory is: "/userstore/gkakas"
Trace: CSftpControlSocket::ResetOperation(0)
Trace: CControlSocket::ResetOperation(0)
Trace: CSftpControlSocket::SendNextCommand(0)
Trace: CSftpControlSocket::ListSend(0)
Trace: state = 1
Command: ls
Status: Listing directory /userstore/gkakas
Trace: CSftpControlSocket::ResetOperation(66)
Trace: CControlSocket::ResetOperation(66)
Error: Failed to retrieve directory listing
Trace: Server exited on signal "ABRT"
Trace: Server exited on signal "ABRT"
Trace: Disconnected: All channels closed
Trace: Disconnected: All channels closed
---------------------------------------------------------
The same behaviour is observed in the following unrelated case
In this directory the following entry exists:
drwxr-xr-x 2 gkakas root 4096 2008-05-23 11:20 test1
Its contents are just a text file
(ls -Al)
total 4
-rw-r--r-- 1 gkakas root 59 2008-05-23 11:20 testfile
When I try to enter this I get the following:
------------------ Failure of list directory ---------------
Status: Retrieving directory listing...
Command: cd "test1"
Response: New directory is: "/home/gkakas/test1"
Trace: CSftpControlSocket::ResetOperation(0)
Trace: CControlSocket::ResetOperation(0)
Trace: CSftpControlSocket::SendNextCommand(0)
Trace: CSftpControlSocket::ListSend(0)
Trace: state = 1
Command: ls
Status: Listing directory /home/gkakas/test1
Trace: CSftpControlSocket::ResetOperation(66)
Trace: CControlSocket::ResetOperation(66)
Error: Failed to retrieve directory listing
Trace: Server exited on signal "ABRT"
Trace: Server exited on signal "ABRT"
Trace: Disconnected: All channels closed
Trace: Disconnected: All channels closed
-------------------------------------------------------------
on the same command, WinSCP gives back:
Connection has been unexpectedly closed. Server sent command exit status 0.
There is no reason for this to happen in this directory. And it does not
happen in any other directory I create.
I also attach below the sshd_config
-----------------------Start of sshd_config--------------------------
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
Hostkey /server/auth/mykey.pem
#HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
------------------------------End of sshd_config-------------------
Reply to: