SSHFS is a filesystem client to mount and interact with directories and files located on a remote server or workstation over a normal ssh connection.
To mount directory in remote server, you will need to install SSHFS
sudo yum -y install sshfs
Once installed, you can simply try to mount your remote server. Note that the remote server must support SSH.
sshfs email@example.com:/data/disk1 /mnt/disk1
Auto-mount remote directory while server boot
If you want to setup auto-mounting remote directory, you need to create your own signature like below
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
While you create your own key, you will need to put your location where to save your key. By default, it will be saved to /YOUR_HOME_DIR/.ssh/id_rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ck/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ck/.ssh/id_rsa.
Your public key has been saved in /home/ck/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
| .+*= o E |
| oo=.o + . |
| +.o + . . |
| . o. o+ . |
| = o=. S. |
| B +o o |
| o +..o . |
|...o +B + |
Follow-up action you need to do is copying ID by ssh-copy-id <id@remote_server>
If everything went well, you will be able to connect to your server without typing pass-phrase like before.
In order to auto-mount remote directory, you will need to add following lines at /etc/fstab
user_id@server_address:<where_to_mount> <target_directory> fuse.sshfs defaults,idmap=user,allow_other,reconnect,_netdev,users,IdentityFile=<your_key_location> 0 0
Below is an working example
email@example.com:/data/disk1 /mnt/disk1 fuse.sshfs defaults,idmap=user,allow_other,reconnect,_netdev,users,IdentityFile=/home/ck/.ssh/id_rsa 0 0