Ladies & Gents
I have been trying to set up a chroot jail for some ssh users. I have been using this how-to
http://www.howtoforge.org/chrooted-s...l-debian-lenny
I tried an earlier one from the same author and didn't have success either.
I am at this point.
I am able to login as the "testuser" provided that I change the sshd_config and comment out the settings for "testuser".
The error is
Code:
:~$ ssh testuser@kingbee
Debian GNU/Linux squeeze/sid
testuser@kingbee's password:
/bin/bash: Permission denied
Connection to kingbee closed.
:~$
The auth.log contains
Code:
Sep 29 18:07:56 Kingbee sshd[25831]: Connection from 127.0.1.1 port 33898
Sep 29 18:07:56 Kingbee sshd[25831]: Failed none for testuser from 127.0.1.1 port 33898 ssh2
Sep 29 18:08:01 Kingbee sshd[25831]: Accepted password for testuser from 127.0.1.1 port 33898 ssh2
Sep 29 18:08:01 Kingbee sshd[25831]: pam_unix(sshd:session): session opened for user testuser by (uid=0)
Sep 29 18:08:01 Kingbee sshd[25839]: Changed root directory to "/home"
Sep 29 18:08:01 Kingbee sshd[25831]: User child is on pid 25839
Sep 29 18:08:01 Kingbee sshd[25831]: pam_unix(sshd:session): session closed for user testuser
So far nothing I have tried has helped.
There were 2 entries in /home/etc/passwd & shadow in the jail for "testuser". The first one I think was a left over from the first attempt, so I deleted them. That didn't change things.
The /etc/passwd only contain one line for "testuser" and it looks like this
Code:
testuser:x:1002:1003::/home/home/testuser:/bin/bash
the one in the jail /home/etc/passwd looks like
Code:
testuser:x:1002:1003::/home/testuser:/bin/bash
The only difference I see is that the home directory is different and points inside the jail from outside.
The permissions on /home/testuser are drwx------(700) and all the files and folders in it are owned by testuser.
The script that builds the jail comes form
http://www.fuschlberger.net/programs...p-chroot-jail/ and talks about pam causing login problems.
Quote:
If you cannot log in (for example on Debian Sarge) and see a warning like "su: Module is unknown" then comment out the following line from $JAIL/etc/pam.d/su:
#session required pam_limits.so
After that logging in will work, although I can't explain why the module in $JAIL/lib/security/ is not found and used.
|
But I don't have /home/jail/etc/pam.d/su I have the folder but not the file. But my error says nothing about a module. I do have /home/etc/pam.d/su and the above is commented out.
I am able to manually enter the jail as root.
Thanks for any advice you can give me.
Recent comments
10 hours 39 min ago
20 hours 7 min ago
20 hours 57 min ago
1 day 30 min ago
1 day 4 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 17 hours ago
1 day 22 hours ago
1 day 23 hours ago