I am trying to jail a user, not permitting it to access anything besides it's home directory. I have installed this Jailkit, and jailed a user named customer01 as it described at Jailkit's official site.
Seems I got everything correct besides some PAM configurations. When trying to switch the user to customer01 by su customr01
and typing the password, seems the session is successfully established, but it exits immediately after launching. Here are the corresponding entries form /vat/log/secure
:
Oct 6 15:19:42 localhost su: pam_unix(su:session): session opened for user customer01
Oct 6 15:19:42 localhost su: pam_unix(su:session): session closed for user customer01
I am guessing that the issue is the PAM authorization. Seems it refuses to authorize the su session. However it seems that the corresponding entries in /etc/passwsd
and /home/jail/etc/passwsd
are created as they should. Here are the corresponding entries form /etc/passwsd
:
customer01:x:506:502::/home/jail/./home/customer01:/usr/sbin/jk_chrootsh
and from /home/jail/etc/passwsd
:
customer01:x:506:502::/home/customer01:/usr/sbin/jk_lsh
So the question is: how can I fix this issue and make the session not to exit automatically?
If my guess is right, and this is a PAM issue, then how can I make PAM to authorize this su session?
P.S. My host is running 32 bit CentOS. Here is what uname -a
returns:
Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux