在chrooted SSH连接成功后,用户立即断开连接

时间:2012-03-16 18:04:22

标签: ssh debian openssh chroot

我在this tutorial之后使用SSH在Chroot中配置了一个监狱。

我找到了another question on StackOverflow dealing with the same problem,但答案对我来说也不起作用。

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以外的所有文件)

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

1 个答案:

答案 0 :(得分:1)

发现问题:某些二进制文件依赖项缺失,即使对于与chrooted帐户关联的shell也是如此...

Shell无法加载 - >断开!

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