Features of SSHFS: Based on FUSE (the best userspace file system framework for Linux) Multithreading: There can be multiple requests on the server Allow large reads (up to 64k) Cache directory contents Step 1: Install fuse-sshfs For CentOS/RHEL users, fuse-sshfs is available under epel repository, so make sure you have epel repository installed in your system. Now execute the following command to install it On CentOS/RHELL: #yum install fuse-sshfs On Ubuntu and Dabian: $ sudo apt-get update $ sudo apt-get install sshfs Step 2: Mount the remote directory Let’s mount the remote server directory using sshfs and make sure the remote system is running an ssh server and the ssh connection with the system is working properly. First create the mount point # mkdir /mntssh Let's mount the remote directory. For this example, we will mount the /home/remoteuser directory from the 192.168.1.12 (remote.example.com) system to the local system. # sshfs [email protected]:/home/remoteuser /opt/mntssh Sample Output The authenticity of host 'remote.example.com (192.168.1.12)' can't be established. RSA key fingerprint is 77:85:9e:ff:de:2a:ef:49:68:09:9b:dc:f0:f3:09:07. Are you sure you want to continue connecting (yes/no)? yes [email protected]'s password: Step 3: Verify Installation After mounting the remote file system on the local mount point, verify it by running the mount command. # mount /dev/mapper/vg_svr1-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw)[email protected]:/home/remoteuser on /mntssh type fuse.sshfs (rw,nosuid,nodev) Also navigate to your mount point and you will see the files from the remote system # cd /mntssh # ls Step 4: Mount the directory at system boot If you want to automatically mount the remote file system on every system reboot, add the following entry in /etc/fstab file. Make sure you have key-based ssh installed between the remote and local systems. [email protected]:/home/remoteuser /mntssh fuse.sshfs defaults 0 0 Step 5: Unmount the directory If your work ends and you no longer need the mounted directory, then simply uninstall using the following command. #umount /mntssh You may also be interested in:
|
<<: Understanding and using React useEffect
>>: js drag and drop table to realize content calculation
Docker underlying technology: The two core techno...
According to major websites and personal habits, ...
Installation Environment Centos Environment Depen...
Hello everyone, I wonder if you have the same con...
Table of contents 1. What is a trigger? 2. Create...
Preface You should often see this kind of special...
Table of contents background Achieve a similar ef...
When using a docker container, sometimes vim is n...
Install jdk: Oracle official download https://www...
reason: MySQL 5.7.5 and up implements detection o...
Use JS to implement a random roll call system for...
The previous article introduced the installation ...
This article shares the specific code of WeChat a...
Installation path: /application/mysql-5.7.18 1. P...
The EXPLAIN statement provides information about ...