Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

OpenSSH SFTP cannot connect

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
naithen
Posts: 212
Joined: 2008-03-03 15:33

OpenSSH SFTP cannot connect

#1 Post by naithen »

Hi,
I have installed OpenSSH and configured the SFTP subsystem, SSH works fine and SFTP works with WinSCP. My problem is when I try to connect using sftp in localhost I get the error:

Code: Select all

subsystem request failed on channel 0
Couldn't read packet: Connection reset by peer
With sftp -v the output is;

Code: Select all

####@localhost's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending subsystem: sftp
subsystem request failed on channel 0
Couldn't read packet: Connection reset by peer
Having a look at /var/log/auth.log shows no unusual outputs;

Code: Select all

sshd[11229]: Accepted password for #### from 127.0.0.1 port 45831 ssh2
sshd[11229]: pam_unix(sshd:session): session opened for user #### by (uid=0)
sshd[11231]: subsystem request for sftp
sshd[11229]: pam_unix(sshd:session): session closed for user ####
My /etc/ssh/sshd_config has

Code: Select all

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes

Match Group sftponly
        PasswordAuthentication yes
        ChrootDirectory %h
        AllowTCPForwarding no
        X11Forwarding no
        ForceCommand internal-sftp
(I'm chrooting the sftp and trying to test that)

I'm running Lenny with OpenSSH_5.1p1

Any help is very much appreciated.

Thanks,

User avatar
naithen
Posts: 212
Joined: 2008-03-03 15:33

Re: OpenSSH SFTP cannot connect

#2 Post by naithen »

This was sorted after changing

Code: Select all

Subsystem sftp /usr/lib/openssh/sftp-server
to

Code: Select all

Subsystem sftp internal-sftp
:)

Post Reply