Google hack: Use Gmail as a Linux filesystem

1 2 3 4 5 Page 3
Page 3 of 5

All subject lines contain an fsname (filesystem name) field that serves two purposes.

  •  Prevents the injection of spurious data into the filesystem by external attackers. As such, the fsname should be chosen with the same care that you would exercise in choosing a password.

  •  Allows multiple filesystems to be stored on a single Gmail account. By mounting with different fsname options set, the user can create distinct filesystems.

Installing the Hack

This isn't for the uninitiated. I haven't provided newbie-focused, step-by-step installation instructions, because if you aren't able to take care of some of these details yourself, you probably shouldn't be mucking about in this hack. If you're out of your depth, sit back, relax and read on for edification's sake.

Before you begin, make sure you have Python 2.3 and the python2.3-dev packages installed.

Install Version 2 or higher of FUSE. Some Linux distributions (such as Debian) make this available as a package, and most newer Linux kernels include FUSE by default. If your distro doesn't have FUSE, you need to download the source and make and install it manually.

Next, you need the Python FUSE bindings. Download and extract fuse-python.tar.gz and follow the instructions in fuse-python/INSTALL.

Tip: The Python FUSE bindings are also available from FUSE's CVS page, but if you grab CVS, remember that the Python bindings don't work with the rest of CVS at the time of this writing; you still need to use FUSE 1.3.

Grab libgmail. After unarchiving the package, copy libgmail.py and constants.py to somewhere Python can find them (/usr/local/lib/python2.3/site-packages works for Debian; others may vary).

Finally, download GmailFS itself and unarchive it. Copy gmailfs.py to somewhere easily accessible (/usr/local/bin/gmailfs.py, for example), and mount.gmailfs (a modified version of mount.fuse distributed with FUSE) to /sbin/mount.gmailfs.

Tip: If you have an older version of Python that interferes with the running of GmailFS and would rather use a newer version, alter the first line of gmailfs.py to point at #!/path/to/newer/python2.3 rather than the #!/usr/bin/env python default.

Take a moment to enjoy just how much you know about such things and move on when you're ready.

Running the Hack

All that remains is to mount your Gmail filesystem.

You can do so via fstab or on the command line using mount. To use fstab, create an /etc/fstab entry that looks something like this:

/usr/local/bin/gmailfs.py /path/of/mount/point gmailfs \\ noauto,username= gmailuser ,password= gmailpass ,fsname= zOlRRa

Replace gmailuser and gmailpass with your Gmail username and password, respectively. The value you pass to fsname is what you'd like to dub this Gmail filesystem.

Warning: It is important to choose a hard-to-guess name here. If others can guess the fsname, they can corrupt your Gmail filesystem by injecting spurious messages into your Inbox (read: sending you mail).

To mount the filesystem from the command line, use the following command:

# mount -t gmailfs /usr/local/bin/gmailfs.py /path/of/mount/point \-o username= gmailuser ,password= gmailpass ,fsname= zOlRRa
1 2 3 4 5 Page 3
Page 3 of 5
How to handle Windows 10 updates
Shop Tech Products at Amazon