On this machine, I am using the Linux operating system. I use Linux both on my remote machine and on my local machine. By using SSH, sshfs (SSH file system) allows you to mount a remote file system on your local system. To mount the remote file system of a remote machine to your local machine, sshfs uses SSH (SSH file transfer protocol). Files can be accessed, transferred, and modified using sshfs as if they were on a local drive.
sudo apt-get install sshfs
steps to mount the remote file system
step 1. create a mount directory in your local machine
first, you need to create a directory in your local machine where you want to mount the remote file system.
sudo mkdir <directory_name_in_local_machine>
step 2. mount the remote file system to your local machine
sudo sshfs [-o options] remote_username@remote_host_ip:<path_of_remote_directory> <directory_name_in_local_machine>
Enter login password for authentication if you are using password authentication. For example:
sudo sshfs -o allow_other,default_permissions username@ip:/home/dk/ /home/pk/mount_prac/
The command accepts a relative path if the private key is under the root user. For example:
sudo sshfs -o allow_other,default_permissions,IdentityFile=~/.ssh/id_rsa username@ip:/home/dk/ /home/pk/mount_prac/
The -o option indicates the presence of added options:
allow_other allows access to users other than root.
The IdentityFile=<private key file path> option is for file systems with configured access via SSH. If the private key is under the root user, the command accepts a relative path. Otherwise, give the full path file.
step 3. check the mounted file system
cd <directory_name_in_local_machine> ls -l
step 4. unmount a remote file system in linux
you can use any of the below commands:
sudo umount -l <directory_name_in_local_machine> or sudo fusermount -u <directory_name_in_local_machine>
Note:- Please report error to firstname.lastname@example.org