LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   "bad passwd file" when logging into Chroot Jail (http://www.linuxquestions.org/questions/linux-security-4/bad-passwd-file-when-logging-into-chroot-jail-727632/)

ddenton 05-21-2009 03:13 PM

"bad passwd file" when logging into Chroot Jail
 
Hello all.

I'm trying to recreate the installation of an existing FTP server set up with a Chroot Jail (download available here: http://sourceforge.net/projects/jail , so we know which one I'm referring to). The original server is going to be replaced, and unfortunately the original server was set up before my time. Having set up SCP Only jails before, I figured this would be straight-forward.

I downloaded and extracted the chroot jail, and installed as instructed. When I followed the procedure for creating the user and the associated home dir in the jail, and attempted to log in, I get the following error:

Code:

jail: chrooted directory /home/jailtest is not configuredfor jail (bad passwd file); bailing out.
Here's the procedure to add the user:

Code:

Linux# /usr/sbin/adduser -g users -d /home/jail/home/jailtest -s /usr/local/bin/jail jailtest
Linux# passwd jailtest
Linux# /usr/local/bin/addjailuser /home/jail /home/jailtest /usr/local/bin/jail jailtest

So, on our existing system, jailed users' home dirs are located under /home/jail/home/<user>, and the chrooted binaries are located in /home/jail/bin. I've checked that all of the necessary binaries are there, and still I get this message when attempting to "su - jailtest". When I attempt to log in remotely using FTP, it won't accept my password. The above procedure to add the user is what we have been using for years to add new users to the jail, but on this new server it just refuses to work.

This has to be something small and simple I'm missing, but I've followed the install instructions to the tee (however short they are).

Has anyone using this jail seen this before?

Thanks!

saavik 05-25-2009 09:09 AM

Don`t you need to sudo chroot ?

ddenton 10-05-2011 09:56 AM

Well, here we are over two years later and this issue still plagues me. The processes are the same as in the original post. Does anyone have any idea why this might be happening? It seems there are a few people several years ago who had this same issue but no clear solution that applied to my setup was found.

Thanks!

vamsi_k 10-17-2011 01:52 AM

Might below url will be helpful :

http://adamsworld.name/chrootjailv5.php


All times are GMT -5. The time now is 02:27 PM.