0

I'm trying to get sftp working with proper chroot configuration on Centos 6.5 server. As for now I get:

sftp [email protected]
[email protected]'s password: 
Write failed: Broken pipe
Couldn't read packet: Connection reset by peer

In /var/log/messages I get:

Connection from 000.000.000.000 port 52365
Accepted password for User from 000.000.000.000 port 52365 ssh2
User child is on pid 0000
fatal: bad ownership or modes for chroot directory component "/"

User section in /etc/ssh/sshd_config:

Match User User
        X11Forwarding no
        AllowTcpForwarding no
        ChrootDirectory /sftp/user

Both /sftp and /sftp/user are set to root:root and 755. As I understand error message, chroot tries to use "/" as directory, instead of "/sftp/user". Why is it so? What may I do to fix it? Thanks for any ideas.

1
  • Can you share an output of ls -lad /? Oct 23, 2014 at 16:24

1 Answer 1

0
ls -lad /
rwxr-xr-x. 30 509 users 4096 Oct 23 13:56 /

Showed that root belongs to non existent user and users group. Simple chown fixed the problem.

chown root:root /

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .