How to mount the remote file system from the remote machine to your local machine?

Introduction

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.

Installation

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 contribute.articles@tech-bloggers.in

2 thoughts on “How to mount the remote file system from the remote machine to your local machine?”

  1. Hi, I think your site might be having browser compatibility issues.
    When I look at your blog site in Safari, it looks fine but when opening
    in Internet Explorer, it has some overlapping.

    I just wanted to give you a quick heads up! Other then that, terrific blog!

  2. Im very happy to find this web site. I wanted to thank you for your time just for this fantastic read!! I definitely liked every bit of it and i also have you book-marked to see new things in your website.

Leave a Comment

Your email address will not be published.