chroot question

Jon Radel jon at radel.com
Tue Apr 21 23:55:34 UTC 2015


>> As root, I ran
>>
>> chroot --userspec=user2:user2 /home/user2
>> chroot: failed to run command ‘/bin/bash’: Permission denied
>>
>> The dir /home/user2 has in it
>> all the *bin and *lib  (links) and usr/*bin and usr/*lib files and 
>> subdirs.
>>
>> So, what is chroot good for???
>> _______________________________________________
>
>
> Why don't YOU read the manual as I have read it fully (it is very short)
> (run  info chroot)
> and then tell us all on the list (do not email me personally), what you
> found wrong with my invocation of the command!!
Toto, we're not in Kansas anymore.

chroot --userspec
/bin/bash
run info chroot

You sure you're running FreeBSD?

using

chroot -u
/bin/csh
man chroot

I can pretty much replicate your error as follows:

root at stream:/home/jon # chmod -x bin/csh
root at stream:/home/jon # chroot -u jon /home/jon
chroot: /bin/csh: Permission denied
root at stream:/home/jon # chmod +x bin/csh
root at stream:/home/jon # chroot -u jon /home/jon
ELF interpreter /libexec/ld-elf.so.1 not found
Abort
root at stream:/home/jon #

Where the 2nd round of errors comes about since I did *not* bother 
copying all the linked "stuff" into the chroot.

So maybe start by making sure the chrooted user actually has permission 
to execute the bin/bash in the chroot environment???

Sometimes error messages mean what they say.  ;-)

--Jon Radel
jon at radel.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3870 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20150421/d7eb724b/attachment.bin>


More information about the freebsd-questions mailing list