Have Some Fun with SSH and Terminal

A friend of mine and I were recently in an Apple Server class. In the course of the class every student is required to set up their server and client using the same username and password. With this little bit of information, the username and password, you can wreak havoc (in a non-destructive way) on your friends computer.

Open Terminal. Just about everything you need to be able to do is from within terminal. The commands are as simple as copying and pasting.

First, SSH into that person’s computer using their sharing name or IP address.

We’re not going to cover how to SSH, it’s very easy, and Google is your friend.

Fun with Sound

sudo osascript -e "set volume 100"

Speech and beeps are made even better with the volume at 100%! So turn that volume up and make them beep and speak!

Fun with Speech

sudo osascript -e 'say "Assistant to the Regional Manager" using "Zarvox"'

Of course this is only funny if you know Dwight Schrute. Creativity is crucial with the speech commands.

Fun with Applications

sudo open /Applications/*

This is my favorite. This command will open every application in the remote users /Applications folder. Pretty funny watching the dock go crazy up and down. For a sample you can try it on your own computer.

Fun with Power

sudo osascript -e 'tell app "Finder" to sleep'

This will force the computer into sleep mode immediately. Combine this with a Speech of “You’ve been owned” for the win.

Fun with a combination of commands

I know my favorite is to open all applications at once, but this is a close second. You’ll want to run these commands about 1 second apart.

osascript -e 'tell application "Finder" to display dialog "System Error 0x0FE: Radiation leak detected. Computer will self destruct in 10 seconds"'

The copy and paste this 10 times, one second apart:

sudo osascript -e "beep"

Not so fun

rm -rf /

Warning!: This command will remove every file on the hard drive. Not so funny on a remote computer. Especially funny for me if you’ve SSH’ed into 127.0.0.1. Keep in mind, this will in fact delete every file on your computer. You’ve been warned!

There you have it. Now all you need is that admin password…

View more Terminal Tips.

Similar Posts:

I Like This Tip!


10 Responses to “Have Some Fun with SSH and Terminal”

  1. 4Avatars
    Discerptor
    These are hilarious! I definitely have to try these out on a remote login sometime.

  2. 4Avatars
    Alex Hwang
    Uh, I tried the sudo open /Applications/* command, and my applications started opening like crazy! Even after I force quitted all of them, they started reopening for some reason, so I had to restart.

    Really Nasty!

  3. 4Avatars
    Brandon Hopkins
    @Alex - Always funny to do these on yourself to see what they do...Now you just need to find a friend and "show" him the new trick you learned!

  4. 4Avatars
    PleanBean
    the beep script doesnt work. It's fun making your own nasty virus automator workflows, downloading them onto your friends computer through terminal, then opening them and reaking havoc.


  5. Trackback

  6. 4Avatars
    Kenta Hood
    Isn't this kind of like teaching people how to make a little virus for the Macs that people say have no problems with this problem? I know you have to the know the ip and password and the like to get it but isn't that something we should be avoiding is giving information to help virus makers out?

  7. 4Avatars
    Discerptor
    According to dictionary.com, a virus is "a segment of self-replicating code planted illegally in a computer program, often to damage or shut down a system or network." This is not a virus in any way, shape or form.

  8. Kenta,

    There are couple reasons I don't see a problem here.

    First and foremost, security through obscurity is no way to handle security at all. Relying on virus makers to not find out information that can exploit your system is a waiting time-bomb for disaster.

    Second, I'm willing to bet anybody that has the ability to make a virus already knows all these commands and many more. To make a virus for a Mac you would have to find a remote exploit. As long as you keep your system up-to-date, you should be safe.

    While you could potentially do some damage with "rm -rf" Brandon didn't add the "sudo" command which is required to actually perform this action. I assume he did this so users didn't unknowingly wipe their systems.

    Add the fact that to run these you need the root password, and it's highly unlikely these will cause anybody any real damage.

    That being said I appreciate your concern. We certainly don't want to tell people how to exploit other people's systems, but this is far from that. This squarely falls in the category of fun.

    Have a great day.

  9. 4Avatars
    Brandon Hopkins
    Hey Kenta, another thing is that none of those lines of code (except rm -rf) does any harm. They just do GUI things like sounds, and opening apps.

    I'm with you though, and would never suggest or post anything that was designed to destroy a system.

  10. 4Avatars
    Anonymouse197
    Hey Guys, is there a way to delay the 'osascript -e 'tell application "Finder" to display dialog "System Error 0x0FE: Radiation leak detected. Computer will self destruct in 10 seconds"'' command until login?

Post a comment to "Have Some Fun with SSH and Terminal"



MacTips Newsletter


Twitter MacTips

  • Stay up to date with the latest Mac tips, tricks and news by following us on twitter: MacintoshTips.

AppleGazette Headlines

Most Popular Tips (30 Days)

Most Commented (30 Days)

Good Tips

Recent Discussions

MacTips Poll

What level of tips would you like to see?

View Results

Loading ... Loading ...

Friends of MacTips

Subscribe to MacTips

Site Links