kintoandar

Android remote filesystem with sshfs

1 minute read

This post was handcrafted some time ago and might be out of date.

Well, now that I’m a proud Samsung Galaxy Ace owner and just entered the amazing world of Android, let the hacking begin!

For my first post on Android I’ll explain how to mount the SDcard through a ssh filesystem on your laptop using wifi.

android_tux

The requirements are pretty strait forward, an Android device (no root necessary) with sshdroid installed, a laptop with sshfs and both connected using wireless.

After starting sshdroid it will present you the IP and port of the ssh server:

sshdroid

You may connect to your device using the laptop with the provided information:

bash
ssh [email protected] -p 2222

The default password is “admin”, I use ssh keys instead as you should too, but I’ll not cover that unless someone asks

Now you’re inside Android, you may list the partition table, just to check, by using:

bash
df

My SDcard is mounted on /mnt/sdcard, this will be useful. You may exit Android ssh connection by typing:

bash
exit

On the laptop make a directory to mount the Android SDcard:

bash
mkdir /media/android

and run sshfs mounting the Android SDcard partition (/mnt/sdcard) on the newly created directory (/media/android)

bash
sshfs [email protected]:/mnt/sdcard /media/android -p 2222

As before it will ask a password, the default password is “admin”

Leave that shell as is and open another one. Type the following on the new shell:

bash
ls -la /media/android

As you can see you have now access to the SDcard locally with read/write permissions.

When you’re done, just unmount the ssh filesystem using:

bash
sudo umount /media/android