Re: Chroot SSH error

From: Joachim Schipper (jDOTschipper_at_math.uu.nl)
Date: 01/28/05


Date: 28 Jan 2005 19:31:39 GMT

rob.ballou@gmail.com wrote:
> Hello,
>
> 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:
> test2:x:514:515::/chroot/home/./test2:/bin/bash
> Thank you in advance for any help.
>
> Rob Ballou

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?

                        Joachim



Relevant Pages

  • Re: To chroot or not to chroot?
    ... > webserver, which should have an http server, webmail, php support, ... > dns, ftp, remote login and a couple more things. ... My understanding of chroot, is that if the service is compromised, then the ... As for login, use sshd and only allow key-based authentication. ...
    (Security-Basics)
  • Re: CHROOT Tutorial?
    ... I followed that with a few modifications to make the chroot ... environment look a little bit more like the natural environment. ... One change I made was to put the jailed shell in ... login: pajaro ...
    (Fedora)
  • Re: CHROOT Tutorial?
    ... I followed that with a few modifications to make the chroot ... environment look a little bit more like the natural environment. ... login: pajaro ... bash-2.05b# pwd ...
    (Fedora)
  • Prefer to use chroot without using login
    ... environment varibles" are left around and has "other issues." ... I don't want to switch to a different TTY to mess with my chroot. ... Should I set up login on another TTY and like SSH into it? ...
    (Debian-User)
  • Re: broken filesystem - give root password for maintenance
    ... It sounds like you cant even get to a login..... ... Can you get to the Login and Login? ... set password and reboot. ... chroot the mounted drive. ...
    (Ubuntu)