我按照本教程在 SSH 中使用 Chroot 配置了一个监狱。
我在 StackOverflow 上发现了另一个处理相同问题的问题,但是答案对我也不起作用。
该auth.log
文件包含以下内容:
Mar 16 18:36:06 *** sshd[30509]: Accepted password for thenewone from x.x.x.x port 49583 ssh2
Mar 16 18:36:06 *** sshd[30509]: pam_unix(sshd:session): session opened for user thenewone by (uid=0)
Mar 16 18:36:07 *** sshd[30509]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Mar 16 18:36:07 *** sshd[30509]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
Mar 16 18:36:07 *** sshd[30509]: pam_unix(sshd:session): session closed for user thenewone
我的sshd_config
文件包含以下内容:
Match User thenewone
ChrootDirectory /home/thenewone
AllowTcpForwarding no
X11Forwarding no
我的/home/thenewone
目录由root:root
chrooted 系统拥有并包含(所有文件,但/home/thenewone/home/thenewone
由 拥有root:root
)
我不明白为什么连接成功然后关闭。