70 likes | 87 Views
Sometimes you may need to mount remote filesystem in Linux. Here are the steps to do so. #Linux #Ubuntu #Redhat <br><br>Visit https://fedingo.com/how-to-mount-remote-filesystem-or-directory-in-linux/
E N D
Install SSHFS Client in Linux First of all, open terminal and run the following command to install SSHFS on your local client system. # yum install sshfs # dnf install sshfs [On Fedora 22+ releases] $ sudo apt-get install sshfs [On Debian/Ubuntu based systems]
Create Mount Directory Once SSHFS is installed, create a mount directory with the following command. # mkdir /mnt/test [RHEL/CentOS/Fedora] $ sudo mkdir /mnt/test [On Debian/Ubuntu based systems]
Mount Remote Filesystem Mount the remote directory /home/test at local mount point /mnt/test. # sshfs user_name@x.x.x.x:/home/test/ /mnt/test [RHEL/CentOS/Fedora] $ sudo sshfs -o allow_other user_name@x.x.x.x:/home/test/ /mnt/test [Ubuntu/Debian] If you are using key-based authentication use following commands # sshfs -o IdentityFile=~/.ssh/id_rsa test@x.x.x.x:/home/test/ /mnt/test [RHEL/CentOS/Fedora] $ sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa tecmint@x.x.x.x:/home/test/ /mnt/test [Ubuntu/Debian]
Verify Remote Filesystem Once the remote filesystem is mounted you can access its contents as if it were a local folder /mnt/test. # cd /mnt/tecmint # ls
Mount Remote Filesystem Permanently If you want to permanently mount a remote filesystem, you need to make the following changes to /etc/fstab file. Open it in a text editor with the following command. # vi /etc/fstab [RHEL/CentOS/Fedora] $ sudo vi /etc/fstab [On Debian/Ubuntu based systems] Add the following line to the bottom of the file. sshfs#user_name@x.x.x.x:/home/test/ /mnt/test fuse.sshfs defaults 0 0 # mount -a [RHEL/CentOS/Fedora] $ sudo mount -a [On Debian/Ubuntu based systems]
Thank You Visit for details https://fedingo.com/how-to-mount-remote-filesystem-or-directory-in-linux/