Humour, Life Skills, Tutorial, Ubuntu

How to Play a Practical Joke on someone with SSH and Stock Ubuntu

Why?

This tutorial is both technical and amusing. There was someone in a room I didn’t want in the room, so I had the idea “I wonder if I can ssh into the computer near them and play some audio out of the speakers and freak them out a bit?”

Turns out I can.
And it worked.
And here’s how to do it with Ubuntu with everything built in and ready to go

HOW – EASY WAY

  1. Make sure you have SSH access to the remote machine that you want to ‘amuse’ someone with.
  2. (OPTIONAL) For extra fun, if you have the time and ability to move your own custom audio files on there, great. Do that prior to the fun, or figure out a more creative version of this tutorial. Otherwise, …
  3. ssh into the remote machine
  4. navigate to /usr/share/sounds/

In here, depending on your ubuntu and distro version, there should be some folders with audio in them. In my case I have ‘alsa’ and ‘freedesktop’ but yours many be different.

  1. Navigate into one of these directories
  2. Simply type command (which is conveniently installed by default…) paplay and then type the audio file you want to trigger. In my case, it was the speaker testing files in the Alsa directory so I typed:

paplay Front_Center.wav

Done. The audio triggered and the person in the room got creeped out and wanted to leave quickly.

High five to self!

HOW – ADVANCED WAY

Some other more advanced thoughts I had, which I didn’t have time to do were, in no particular order:

  • Setting up a quick http server on my local machine (see this tutorial] where I have more audio control, then with SSH running on the other machine navigate back to that directory and play it that way.. this worked
  1. On local machine, set up Http server
  2. On local machine run ip address command to note your local IP address (you’ll need it below)
  3. On local machine set up, or have ready a dedicated folder for audio sounds, music, etc, that you want to play over the remote machine
  4. SSH into remote machine
  5. cd to a place that you’d like to download these audio files
  6. run this command which will download the whole directory from your local machine to your remote machine: wget http://123.123.123.123:99 where 123.123.123.123 is your ip address and 99 is the port you chose to serve. This will download all the files and leave a directory with the ip address and port as the directory name. It also may leave quotation marks around file names so you’ll have to include those when running commands…
  7. Navigate into the new directory of tunes
  8. Select the tune you want to play and run paplay tune-name.mp3
  9. press control c to stop the command and stop playing the file
  10. when complete delete directory with sudo rm -r directory name

OTHER IDEAS?

  • Maybe some other easy command like curl or wget can easily pull audio onto remote machine..
  • Streaming youtube or something through there with VLC player which I think has a CLI

Enjoy!

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *