Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the latest OpenSSH, I have a group "members" with 5 users. I need to get SFTP to certain directory, nothing else. I seem to be able to do it with Chroot, but it's not working. Heres my /etc/ssh/sshd_config: Subsystem sftp internal-sftp

Match Group members
        ChrootDirectory %h
        ForceCommand internal-sftp
        AllowTcpForwarding no

My error is this:

connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused
Couldn't read packet: Connection reset by peer

I'm lost.

share|improve this question
2  
What version of OpenSSH are you using? "Latest" won't mean much after a couple of months. Also, what about the logs from the server? –  Cristian Ciupitu Oct 5 '12 at 20:30
2  
Though it is almost certainly not related to your connection refused message, you should read closely about the permissions required for the ChrootDirectory setting. The permissions requirements are very strict. –  Zoredache Oct 5 '12 at 20:54

1 Answer 1

The connection refused message usually means that there is nothing listening on the relevant interface:port.

The default for sshd is to listen on port 22 on all interfaces so the error message suggests that your sshd isn't configured to listen on 127.0.0.1:22.

Check /etc/ssh/sshd_config to ensure that sshd is listening on port 22, if it's not then there will be a Port directive. Use -p with your utilities to connect to the non-standard port.

Check to see if sshd has been restricted to particular interfaces - there will be ListenAddress directives - if configured try connecting on the relevant IP address.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.