-1

我按照本教程在 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:rootchrooted 系统拥有并包含(所有文件,但/home/thenewone/home/thenewone由 拥有root:root

我不明白为什么连接成功然后关闭。

4

1 回答 1

1

发现问题:缺少一些二进制文件依赖项,即使是与 chrooted 帐户关联的 shell...

Shell 加载失败 --> 断开连接!

如果您遇到与我相同的问题,请使用ldd <binary>在 chroot 监狱中查找所有需要的依赖项

于 2012-03-17T06:24:39.503 回答