I use the following configuration and it worked successfully for restricting the ssh user to a particular folder but when I change the permission of the group to read+write, the user can't login to the server
In /etc/passwd
I changed
/bin/bash
of user to /bin/false
In /etc/ssh/sshd_config
I added
Subsystem sftp internal-sftp
Match Group dnduser
ChrootDirectory /home/dnduser
ForceCommand internal-sftp
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
Working /home/dnduser
directory permissions without write permission
#chmod 755 /home/dnduser -R
#chown root:dnduser /home/dnduser -R
When I change the permission to
#chmod 775 /home/dnduser -R
the user can't login
~/.ssh
on the remote machine?ssh
enforces some basic things like "private keys must not be readable to anybody but the user", I wouldn't be surprised by "authorized_keys must not be writeable by anybody but the user". – Ulrich Schwarz Sep 08 '16 at 05:03