Mount Remote Filesystems Over SSH Using SSHFS
We, all, use NFS, Samba and OpenAFS to mount and access remote file systems over network. Unfortunately we need administrative privileges on both side to setup NFS, Samba or OpenAFS servers. No more worries, we can now mount and access remote file systems without any additional software using SSHFS. Since all modern operating system supports SSH, we can easily mount and access remote filesystem trees on our local system.
SSHFS is a filesystem client based on the SSH File Transfer Protocol. Since most SSH servers already support this protocol it is very easy to set up. On the client side mounting the filesystem is as easy as logging into the server with ssh. We don’t have to do any setup or configuration on the server side. All you need is the remote server should have a working SSH server.
- Based on FUSE (the best userspace filesystem framework for linux ;-)
- Multithreading: more than one request can be on it’s way to the server
- Allowing large reads (max 64k)
- Caching directory contents
Install SSHFS On Linux
SSHFS is available in the default repositories of Debian/Ubuntu and it’s derivatives. So we can install it with root privileges using command:
# apt-get install sshfs
SSHFS is not available in the default repositories. So let us add EPEL repository to install SSHFS.
To add EPEL repository on RHEL/CentOS 6.x systems, go to the EPEL website, download and install as shown below.
# rpm -Uvh http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
Now update package lists and install sshfs as shown below.
# yum update # yum install sshfs
The usage is very simple.
$ sshfs hostname-of-remote-system:<directory-path> mountpoint
$ sshfs ip-address-of-remote-system:<directory-path> mountpoint
Please note that you don’t need to be a root user to mount remote filesystems using SSHFS. Just log in as a regular user and mount the remote filesystem.
For example, I am going to mount my Debian server directory to my local Ubuntu desktop.
Create a mount point on local system.
$ mkdir /home/sk/sshfs/
Mount the remote system directory on /home/sk/sshfs/ directory using command:
$ sshfs email@example.com:/ /home/sk/sshfs/
In the above i mounted the root(/) directory of my remote Debian server to my Ubuntu Desktop.
192.168.1.200 – Debian server IP address.
/ – My Debian server root directory which is going to be mounted on local system.
/home/sk/sshfs – My local Ubuntu system mount point.
Now you can check whether the remote system directory is mounted either using Terminal:
$ df -h
Filesystem Size Used Avail Use% Mounted on /dev/sda1 292G 238G 40G 86% / none 4.0K 0 4.0K 0% /sys/fs/cgroup udev 989M 12K 989M 1% /dev tmpfs 200M 872K 199M 1% /run none 5.0M 0 5.0M 0% /run/lock none 998M 6.7M 991M 1% /run/shm none 100M 20K 100M 1% /run/user firstname.lastname@example.org:/ 19G 16G 2.0G 89% /home/sk/sshfs
or you can check from your file manager.
$ fusermount -u /home/sk/sshfs
For more detailed information please look into the official FAQ page.
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- News from Kaspersky Lab: Tor is protecting criminals : In a previous article I wrote a bit about Tor. Free browser, relays bouncing your IP all over the ...1 comment |
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...2 comments |
- How To Access A LVM Drive / Partition in Ubuntu : Hey Guys, I installed Fedora on an external drive (LVM) recently and was trying to access it from U...0 comments |
- Adding and Deleting Cluster Resources (corosync pacemaker) : In our previous tutorial, we have shown you how to install corosync and pacemaker. We will show y...0 comments |
- Install Satis On Ubuntu Sever 13.10/13.04 : Satis is a simple static composer repository generator. It is used in any composer.json file as i...0 comments |
- Adding and Deleting Cluster Resources (corosync pacemaker)
- News from Kaspersky Lab: Tor is protecting criminals
- Install Satis On Ubuntu Sever 13.10/13.04
- How To Access A LVM Drive / Partition in Ubuntu
- How To Disable Remember Open Files in Sublime Text 3
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .