In this thread from a couple days ago I mentioned that I used to be an Instructor for Red Hat and that many of us had an evil bag of tricks.
As an instructor, I occasionally came across either very cocky or very bright students that would go through the class work each day faster than anyone else. The bright ones I liked, they were always engaged and eager to learn. The cocky ones, well, they got old fast. Always first to pipe up and try to show off their knowledge to others in class. Sometimes even trying to test my own knowledge with obviously leading questions that they already knew the answer to.
Both types would often ask for additional work after they completed the day's tasks to help them brush up on troubleshooting problems. This is where the bag of tricks comes in. I always kept a list of various things I could do to the student's workstations to keep them busy for a while. These tasks were very good for taking the cocky ones down a notch or two. The bright ones loved the challenge. A few people asked for this list so I dug around and found a few to pass on. Many of these were passed on to me from other instructors. We even had a mailing list devoted to trading 'evil instructor tricks'.
I'll type out the breaks I did to their systems, what I told them, and where appropriate I'll put a possible fix at the end of the post. Some of these have many ways to fix it. Mine is just one. I apologize for any typos. Instructors are, after all, just human. ;) I tried to make them as readable as possible within the limits of the reddit commenting system.
NOTE: Use any of the following at your own peril. Some will break your machine. They were all recoverable by me in a classroom setting in under a minute but I make no guarantee for your systems. If you do break a system of yours using these and need help I'm always open to earn some sweet, sweet consulting money to help fix it. ;) Also, if you use these on fellow cow-orkers don't blame me if you get your ass kicked.
This first one was always my go-to. If they asked for more I'd start down the list. The use of Google or any other online resource was not allowed to help fix any of these problems. They had to be done using only the tools on their server like in a test environment.
1:
What I'd tell the student: "Your server has been cracked. The baddies have changed your homepage and it's not flattering to your company. Get rid of their page and restore the index.html that was backed up to '/tmp/index.html'."
What I did to their system: 'cp /var/www/html/index.html /tmp' Make a change to the index.html. 'chattr +i /var/www/html/index.html'
In the 4 years or so I did this and dozens of students only one figured it out in a reasonable time frame.
2:
To the student: "Some moron ran 'chmod -x /bin/chmod' on your server. Fix it. You can not reinstall the package that provides chmod."
3:
To the student: "Send me a copy of the output of 'ls /etc'."
The break: Add this to their .bashrc. 'alias ls="echo \"I'm sorry, Dave. I can't do that.\""; alias alias="echo \"I'm sorry, Dave. I can't do that.\""; alias unalias="echo \"I'm sorry, Dave. I can't do that.\""'
4:
As part of the classes we taught students how to use vi. Some basic knowledge of vi/vim is a must for any good Linux admin. I've seen nano users break way too many config files for my liking. If I caught them using something like nano I'd do this:
'mv /bin/nano /bin/nano.nono; ln -s /usr/bin/vim /bin/nano'
5:
"Your system no longer boots. Figure out why."
The break: 'mv /bin/bash /bin/bash.gotcha' then reboot their system. I would provide rescue media if they needed it.
I have more but after a few of these most students were happy to return to redoing the bookwork over rather than ask me for more and more devious breaks of their workstations. To a seasoned admin these should be fairly obvious and easy to fix. When you're trying to go fast to show off for your instructor they get a bit harder. :)
I really loved that job and found it very rewarding. Seeing the glimmer of understanding in a student's eye when they finally got that difficult subject matter made the frustration of dealing with others more than worth it.
Fixes:
1:
You can use 'lsattr' to see attributes on a file and use 'chattr -i /var/www/html/index.html' to remove the immutable bit.
2:
One possible fix:
cp /bin/cpio /tmp; cat /bin/chmod > /bin/cpio; /bin/cpio +x /bin/chmod; cp /tmp/cpio /bin; chmod +x /bin/cpio
3:
One possible fix: 'builtin unalias unalias'. This tells bash to use it's built in 'unalias' command instead of using /usr/bin/unalias to unset the unalias. From there the rest is easy.
4:
'rm -f /bin/nano; mv /bin/nano.nono /bin/nano'
Yes, I know about 'nano -w'. I've been doing this 20 years. I'm a 'vi' bigot at heart.
5:
Boot off rescue media. Mount the file system and start poking around. About 20% of students would find the renamed file. The rest would either reinstall the rpm or copy the bash binary from the rescue media.
[link][115 comments]