![为使用 open-ssh 的用户提供简单的监狱](https://linux22.com/image/597786/%E4%B8%BA%E4%BD%BF%E7%94%A8%20open-ssh%20%E7%9A%84%E7%94%A8%E6%88%B7%E6%8F%90%E4%BE%9B%E7%AE%80%E5%8D%95%E7%9A%84%E7%9B%91%E7%8B%B1.png)
我可以使用简单的 open-ssh 配置将用户限制在他们的 /home/%u 目录中吗?我根据在互联网上找到的内容执行了以下操作停止服务器在 sshd_config 文件中附加了以下内容
Match group sftpusers
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
启动服务器
仅供参考,我已将用户添加到 sftpusers 组
我的用户仍然可以访问我的系统上的整个文件结构
安装了 open-ssh 的 Ubuntu Server 12.04 LTS
答案1
我在 OpenSSH_5.3p1 上使用它并且它运行正常:
Subsystem sftp internal-sftp
Match group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding yes
ForceCommand internal-sftp