In Ubuntu, I have this SSH server configuration set up in /etc/ssh/sshd_config
:
Subsystem sftp internal-sftp
UsePAM yes
ChrootDirectory %h
ForceCommand internal-sftp
GatewayPorts no
AllowTcpForwarding no
KeepAlive yes
IgnoreUserKnownHosts no
Match group sftp
But even users not in sftp
are being restricted by chroot. For example when bobby
(not in sftp
) tries to SSH in, this error occurs:
sshd[17977]: fatal: bad ownership or modes for chroot directory "/home/bobby"
I have tried this:
Match group sftp, User !bobby
And restarting the service, but the same issue occurs.