Public domain
chmod u+s $(readlink -f $(which screen))
[ ! -e /bin/rbash ] && ln -sf bash /bin/rbash
useradd -m -s /bin/rbash students
passwd students
trap "" 2 3 20
clear
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
exit
source ~/.profile
#!/bin/bash
source /etc/profile
screen -wipe
if ! ls /root/.screen/*linux-class* &> /dev/null; then
screen -dmS linux-class
fi
TMP=$(mktemp)
cat > ${TMP} << EOF
multiuser on
acladd students
aclchg students -wx "#,?"
aclchg students +x "detach"
EOF
screen -r linux-class -X source ${TMP}
rm ${TMP}
/root/linux-class.sh
screen -x linux-class
ssh students@hostname
BY: Pejman Moghadam
TAG: screen, trap, suid, rbash
DATE: 2011-12-10 10:06:56