Chroot SSH error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have setup a chroot ssh user on a box and I'm having trouble getting
their login to process, so I was hoping someone would help. I have
found many a page on this in google, but no solutions have worked yet.

I think the problem lies in my chroot jail, because here is the
symptoms (I'm running Fedora Core 3 with a chroot ssh patched SSHD):

- the user logs in via SSH
- the login is successful (which can be verified in /var/log/secure)
- then the following error happens:

'/bin/bash': No such file or directory

What is strange is if I run:

chroot /chroot/ /bin/bash

It runs just fine. If I run /chroot/home/test2/ I get the error. If I
run chroot /chroot/ I get the bash shell prompt.

I have triple checked the libraries with ldd for /bin/bash. The user's
/etc/passwd entry looks like:
Thank you in advance for any help.

Rob Ballou

Re: Chroot SSH error wrote:
Quoted text here. Click to load it

I am not sure I understand you entirely, but if I read this post
correctly you note that bash works when chrooting under /chroot, but not
when chrooting under /chroot/home (note where you placed the dot). This
doesn't seem strange to me - there probably just is no
/chroot/home/bin/bash. ;-)

Does chroot /chroot/home /bin/bash work?


Re: Chroot SSH error

All this time and it was right in front of me :)

Yes, I moved the so that:

is now:

and it works.

Thank you very much for pointing that out. I did realize that chroot
/chroot/home/test2 wouldn't work (because that's not where /bin/bash
will be located).

Again, thank you for your help.

Site Timeline