Simple Secure Screenshot Sharing For Ubuntu
If you’ve ever wanted to share a screenshot with someone, you undoubtedly know the hassle it is to save your screenshot somewhere then share it though email or uploading it to an image sharing site. The need to make this easier has been met for Windows and OS X users for some time now with TinyGrab.
This need has also been somewhat met for Linux users with a great screen capture utility called Shutter. Shutter has the option to upload to a remote server but the way it does is not as streamlined as TinyGrab. First, the upload options is something that you have to do manually after you’ve already taken the screenshot. The second is that you are then left with a copy on your hard drive that you have to manually delete. The third is that it only supports FTP which as most people know is entirely insecure.
I’ve come up with a combination of tools that allows Shutter to function as a much more capable screenshot sharing tool. These tools are a remote server you can SSH into, a web server (lighttpd in my case), SSHFS, and of course Shutter. Here’s how to do it.
The secret to the magic is SSHFS. It will allow us to mount a remote folder via SSH. This makes sending files to that server as easy as drag-and-drop and since it goes through SSH it’s encrypted and secure. Now then, let’s get started. Please note that this example will assume this is all being done with Ubuntu so modify this tutorial for your distro.
1. SSH into your remote server and create a folder on the file system which will contain your uploaded screenshots. Throughout this tutorial, remember to replace “myhost.com” with your remote host’s URL and “remoteuser” with your username.
localuser@localcomputer:~$ ssh remoteuser@myhost.com
remoteuser@remotecomputer:~$ mkdir ~/screenshot_uploads
2. We need a web server to make our screenshots accessible over the internet. Assuming that there isn’t a web server already installed, a simple need such as this is easily met by lighttpd.
remoteuser@remotecomputer:~$ sudo aptitude install lighttpd
3. Point the web server document root at our screenshot_uploads folder. To do this open “/etc/lighttpd/lighttpd.conf” in your command line text editor of choice and set “server.document-root” to “/home/remoteuser/screenshot_uploads”. The end result will look like
server.document-root = "/home/remoteuser/screenshot_uploads"
Normally it is not advisable to assign the entire document root to such a folder. This is going under the assumption that this web server will be used for nothing but screenshot sharing. If your needs are different you should modify this part of the tutorial to fit them. After you’ve made the change, restart the web server.
remoteuser@remotecomputer:~$ sudo /etc/init.d/lighttpd restart
At this point, your screenshots folder should be accessible from http://myhost.com. Be sure port 80 is open for that your remote server.
4. Log out of the SSH session and install SSHFS.
remoteuser@remotecomputer:~$ exit
localuser@localcomputer:~$ sudo aptitude install sshfs
5. Now we can mount our remote folder to our local machine. We will assume that our local folder is /home/localuser/screenshots.
localuser@localcomputer:~$ sshfs remoteuser@myhost.com:screenshot_uploads \
/home/localuser/screenshots
Now anything placed in /home/localuser/screenshots will be automatically sent to the screenshot_uploads folder on your remote server.
6. If you haven’t done so already install Shutter. Then open Shutter and go to Edit->Preferences and set the save directory to be your SSHFS mounted folder. You may want to consider mapping the take screenshot action to a keyboard shortcut. After that it will look something like this.

That’s it! Take a screenshot, point your browser at the URL for your web server, grab the link and send it to your friends. Truthfully, you can use any screenshot tool and point it at your sshfs mount and it will give you the same result. Shutter just does it in a much more polished fashion.
There are some final considerations. There are the piles of screenshots you’ll undoubtly accumulate from using this nifty setup. On my server I set a daily crontab command to clear out that directory. Another may be have your SSHFS mount set up automatically at boot time. This could be done by registering a public key for your computer with the remote server and adding an entry to the /etc/fstab file that looks like this.
sshfs#remoteuser@myhost.com:/home/remoteuser/screenshot_uploads /home/localuser/screenshots fuse user,auto 0 0
Happy screenshot sharing!
