Linux

jailkit chroot 終止 ssh 登錄

  • April 1, 2011

我已盡力按照這些說明創建 chroot shell。但是每次我嘗試通過 ssh 為我的新 chroot 使用者登錄時,連接都會終止。

我啟動我的 ssh 終端,通過 chrooteduser 登錄,然後一旦我登錄它就會退出……

我是很多 linux 世界的新手,所以我不確定是什麼導致了這個問題。

編輯

這是 chrooteduser 嘗試登錄的日誌:

Apr  1 06:55:13 li244-40 sshd[2453]: Accepted password for testroo from 114.77.115.211 port 57658 ssh2
Apr  1 06:55:13 li244-40 sshd[2453]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
Apr  1 06:55:13 li244-40 sshd[2453]: pam_unix(sshd:session): session opened for user testroo by (uid=0)
Apr  1 06:55:13 li244-40 sshd[2466]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
Apr  1 06:55:14 li244-40 jk_chrootsh[2468]: path /home/newroo/./home/testroo is not owned by group 5004
Apr  1 06:55:14 li244-40 jk_chrootsh[2468]: abort, path /home/newroo/./home/testroo does not have group owner 5004, set option 'relax_home_group' to relax this check
Apr  1 06:55:14 li244-40 sshd[2453]: pam_unix(sshd:session): session closed for user testroo
Apr  1 06:55:14 li244-40 sshd[2453]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory

好的,問題解決了。難道你只是喜歡解決自己的問題!

問題是 chroot 的主目錄沒有正確的權限。正如我通過查看日誌發現的那樣。

引用自:https://serverfault.com/questions/254478