Operating System - Linux
1826331 Members
3438 Online
109692 Solutions
New Discussion

Re: rm and mkdir permission in chroot ID

 
Rob_Taylor
Advisor

rm and mkdir permission in chroot ID

Hi.

I have setup a chroot-ed ID on HP-UX 11.23 and it works fine with the exception of file manipulation. I can not do an rm, mkdir rmdir etc. within it's chroot directory. I did copy those specific commands over into the chroot-ed ID's own /usr/bin directory.

Ideas?
Rob
5 REPLIES 5
George Liu_4
Trusted Contributor

Re: rm and mkdir permission in chroot ID

how is the chroot directory mounted? read only?
Rob_Taylor
Advisor

Re: rm and mkdir permission in chroot ID

Hi,

No the chroot dir is 755 permissions.

Rob
George Liu_4
Trusted Contributor

Re: rm and mkdir permission in chroot ID

I am asking if the directory is separately mounted with option ro instead of rw
Rob_Taylor
Advisor

Re: rm and mkdir permission in chroot ID

Sorry,

It is mounted with rw and not ro.

Rob
Mike Stroyan
Honored Contributor

Re: rm and mkdir permission in chroot ID

When you copy commands into a chroot directory you need to be aware of what shared libraries each command depends on. If you run "ldl /usr/bin/rm" you will see that the command depends on shared library files that you would need to copy into /usr/lib under the chroot.

An alternative is to look for a statically linked version of each command that you want to use under the chroot. There are statically linked versions of several commands in /sbin.
Those are there for use when a system is booted without /usr mounted.

By the way, you asked an HP-UX question in a linux forum. HP-UX and linux have a lot in common in this case.