How To Mount a Remote Directory With SSHFS on a Linux
How can I mount a remote directory with ssh on a Linux bases system? How do I use SSHFS to mount remote file systems over SSH on a Ubuntu or Debian/RHEL/CentOS/Arch Linux system?
SSH is a secure protocol and you can use it to mount a directory on a remote server or local laptop with the help of the SSHF service. With SSHFS you can mount remote server file system to your local development workstation/laptop powered by Linux. [donotprint][/donotprint]
More on SSHFS
sshfs is a filesystem based on the SSH file transfer protocol. It is used on a client system i.e. you need to install sshfs package on your local computer/laptop powered by CentOS/RHEL/Ubuntu/Debian/Arch Linux. No need to install anything on server (server1.sxi.io). You only need an openssh server installed on server side. Our sample setup:
[sudo] password for nixcraft:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 41.7 kB of archives.
After this operation, 138 kB of additional disk space will be used.
Get:1 http://mirror.ox.ac.uk/sites/archive.ubuntu.com/ubuntu/ trusty/main sshfs amd64 2.5-1ubuntu1 [41.7 kB]
Fetched 41.7 kB in 1s (27.8 kB/s)
Selecting previously unselected package sshfs.
(Reading database ... 247545 files and directories currently installed.)
Preparing to unpack .../sshfs_2.5-1ubuntu1_amd64.deb ...
Unpacking sshfs (2.5-1ubuntu1) ...
Processing triggers for man-db (126.96.36.199-1ubuntu1) ...
Setting up sshfs (2.5-1ubuntu1) ...
The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.