If you have two or more servers and need to share files between them instead of transferring files manually (which may be time-consuming and challenging), you can use sshfs
. This tool allows you to connect a remote file system to your local system. Basically, the files are on your server while they actually reside on another server. This method is particularly useful for servers that need access to numerous datasets or for servers that utilize external storage resources frequently.
To install sshfs
and connect to a remote server, start by executing the following command:
# Install sshfs
sudo apt install sshfs
# Connect one server to another server
sshfs user@remote_server:/path/to/storage /local/mount/point
🔵 sshfs:
A tool for mounting files via SSH that allows you to connect files from one server to another server.
🔵 remote_server:/path/to/storage:
The path for the files on the remote server.
🔵 /local/mount/point:
The mount point on the local server that you want to use to access the files.
Example in action: Suppose you have a server that has heavy datasets and you want easy access to this data from other servers. Instead of transferring the files, you can use sshfs
to mount these files on your own server, making them accessible as if they were local.