How do I allow a user to use SCREEN on a chrooted user?
I have tried everything but I keep on failing.
I need the user to be able to use SCREEN when they are logged in bash as a chrooted user.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
SCREEN probably needs devpts, the pseudo-terminal filesystem, to be mounted on
/dev/pts inside the chroot.
mount -t devpts none "$rootpath/dev/pts" -o ptmxmode=0666,newinstance ln -fs "pts/ptmx" "$rootpath/dev/ptmx"
newinstance flag is optional; it gives the user a completely separate pty list, preventing them from knowing what other users are logged in.)
In out-of-stock Ubuntu-14.04 this also can be achieved with one "mount" and one "chmod".
/mnt/old is chroot's target directory (new "root").
Also assumed user
user belongs to group of
/mnt/old/run directory (will be a
/run in chroot-ed environment).
sudo mount --bind /dev/pts /mnt/old/dev/pts
sudo chmod g+w /mnt/old/run
sudo chroot --userspec=user:user /mnt/old
Caveats: Not sure if sharing of
/dev/pts is really a good idea from security perspective, and I would not recommend this method if security is of concern.