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
Once installed, you can simply try to mount your remote server. Note that the remote server must support SSH.
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
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
You may want pem file in some cases, and below commands can do that:
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
Below is an working example
Note that I had a problem that the CentOS server can't auto-mount by sshfs in some cases, delay_connect solved my paint points, and it doesn't make any performance issues but stable auto-mounting in the latest multi-core servers.
In AWS EC2, you will need to use keypair to access your server, and following is an example to auto-mount your AWS EC2 instances:
Note that your-keypair_root.pem should be owned by root with 400 in permission, sshfs# need to be added to the account information, and fuse.sshfs needs to be changed to fuse.