To mount a remote directory using SSHFS on a Linux system, follow these steps:
- Install the
sshfs
package, which provides support for mounting remote directories via SSH:
sudo apt-get update
sudo apt-get install sshfs
- Create a mount point for the remote directory, for example:
sudo mkdir /mnt/remote
- Mount the remote directory using the
sshfs
command:
sshfs <user>@<remote_host>:<remote_directory> /mnt/remote
- Verify that the remote directory has been successfully mounted by listing the contents of the mount point:
ls /mnt/remote
Replace <user>
, <remote_host>
, and <remote_directory>
with the appropriate values for your environment. The <user>
is the username on the remote host, <remote_host>
is the hostname or IP address of the remote host, and <remote_directory>
is the path to the remote directory you want to mount.
When you’re finished using the remote directory, you can unmount it using the following command:
sudo umount /mnt/remote