Page 1 of 1

List processes in a chroot

PostPosted: Sat Dec 23, 2006 8:10 pm
by __nico__
Is there a way to list all the process that are in the same jail?
I know that FreeBSD jail can do that but is there something equivalent in grsecurity?

Thanks

This used to work for me

PostPosted: Wed Jan 03, 2007 5:15 pm
by Alexei.Sheplyakov
Code: Select all
CHROOT="/path/to/chroot"
PROCS=""
for p in `ps -o pid -A`; do
   if [ "`readlink /proc/$p/root`" = "$CHROOT" ]; then
      PROCS="$PROCS $p"
   fi
done
echo "Jailed in \"$CHROOT\": $PROCS"

PostPosted: Wed Jan 03, 2007 9:24 pm
by spender
grsecurity's chroot restrictions can enforce that users inside a chroot jail can only view processes within the same jail.

-Brad

PostPosted: Fri Jan 05, 2007 6:53 am
by Alexei.Sheplyakov
spender wrote:grsecurity's chroot restrictions can enforce that users inside
a chroot jail can only view processes within the same jail.


Yes, so if /proc is mounted inside a jail (usually it is not) one can do

Code: Select all
chroot /path/to/jail ps -A