I've been trying to configure sftp in a debian server.sshd_config:
Subsystem sftp internal-sftp
UsePAM no
Match User sftpUser
ChrootDirectory /users/sftp/sftpUser
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
Directories:
drwxr-xr-x 3 root root 4096 Oct 20 10:59 users
drwxr-xr-x 3 root root 4096 Oct 20 11:00 sftp
drwxr-xr-x 2 root root 4096 Oct 20 11:00 sftpUser
cat /var/log/auth.log
Oct 20 10:58:22 w1 sshd[24634]: Accepted password for sftpUser from 201.156.103.213 port 34106 ssh2
Oct 20 10:58:22 w1 sshd[24636]: fatal: bad ownership or modes for chroot directory component "/"
sftpUser no home, bin/false
and member of user group.
In the client side I'm getting the famous Write failed: Broken pipe
and then the connection is dropped.
Commenting the ChrootDirectory
command in sshd_config makes the connection, but get's the user loose.
What am I doing wrong ?