Pejman Moghadam / Slackware

Slackware 13.1 - Sharing Screen sessions in Linux classrooms

Public domain

SetUID for screen binary

chmod u+s $(readlink -f $(which screen))

Add a restricted user

[ ! -e /bin/rbash ] && ln -sf bash /bin/rbash
useradd -m -s /bin/rbash students
passwd students


trap "" 2 3 20
echo "Welcome to the Linux Class"
echo "You can enter <Ctrl-a d> to detach at any time or just close your terminal"
echo -n "Press Enter to continue..." && read
screen -x root/linux-class


    source ~/.profile


source /etc/profile
screen -wipe
if ! ls /root/.screen/*linux-class* &> /dev/null; then
  screen -dmS linux-class
cat > ${TMP} << EOF
multiuser on
acladd students
aclchg students -wx "#,?"
aclchg students +x "detach"
screen -r linux-class -X source ${TMP}
rm ${TMP}

Start and attach to linux-class session

screen -x linux-class

remote access to linux-class session

ssh students@hostname

BY: Pejman Moghadam
TAG: screen, trap, suid, rbash
DATE: 2011-12-10 10:06:56

Pejman Moghadam / Slackware [ TXT ]