Android remote filesystem with sshfs

1 minute read

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:

ssh root@10.0.2.15 -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:

df

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

exit

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

mkdir /media/android

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

sshfs root@10.0.2.15:/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:

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:

sudo umount /media/android

Leave a comment