SSHFS stands for (Secure SHell FileSystem) client that enable us to mount remote filesystem and interact with remote directories and files on a local machine using SSH File Transfer Protocol (SFTP).
Because SSH uses encryption while transferring files over the network from one computer to another computer and SSHFS comes with built-in
FUSE (Filesystem in Userspace) kernel module that allows any non-privileged users to create their file system without modifying kernel code.
Install SSHFS in RHEL, CentOS and FedoraStep 1: Installing SSHFS# yum install sshfs
Step 2: Creating SSHFS Mount Directory# mkdir /mnt/local_sshfs_dir
Step 3: Mounting Remote Filesystem with SSHFS# sshfs username@x.x.x.x:/home/remote_sshfs_dir/ /mnt/local_sshfs_dir
Step 4: Verifying Remote Filesystem is Mounted# cd /mnt/local_sshfs_dir
# ls
For example:
# cd /mnt/local_sshfs_dir; ls
./ cgi-bin/ cron.php .gitignore index.php install.php LICENSE.txt modules/ robots.txt themes/ web.config
../ CHANGELOG.txt drupal-7.22.bak/ .htaccess INSTALL.mysql.txt INSTALL.sqlite.txt MAINTAINERS.txt profiles/ scripts/ update.php xmlrpc.php
authorize.php COPYRIGHT.txt drupal-7.22.tar.gz includes/ INSTALL.pgsql.txt INSTALL.txt misc/ README.txt sites/ UPGRADE.txt
Mounting Remote Filesystem PermanentlyTo mount remote filesystem permanently, you need to edit the file called
/etc/fstab and add the following.
# vi /etc/fstab
sshfs username@x.x.x.x:/home/remote_sshfs_dir/ /mnt/local_sshfs_dir fuse defaults 0 0
Next, you need to update the fstab file to reflect the changes.
# mount -aTo unmount:
# umount /mnt/local_sshfs_dir