Article title: use sshfs to Mount hosts all over the world to your computer. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
If you use sshfs to Mount hosts all over the world to your computer, this may be a bit of an eye-catching sensation, because achieving this goal requires an important premise, you must have a valid logon account for the remote host and provide SSH access to the host. as a result, the range is reduced.
How to proceed? Come with me!
1. why should we do this and the benefits?
Oh! This question? Mm..., what do you think if your operations on remote host files are as simple and direct as those on your hard disk? In fact, it is a partition, a directory, and a hard disk in front of you! So cool? This is its benefit.
[Figure] Local remote host Directory
2. how to start?
You must create a mount point under the/mnt Directory. Simply put, you must create a read/write directory and use sshfs to talk about the hard disk of the remote host, A partition or directory is attached to this directory for simple access and operations on the file system of the remote host.
3. install software
Sudo apt-get install sshfs fusemount
4. instance operations
In this instance, we need to mount "/home" on the remote host "192.168.1.218" to "/mnt/server218" on the local system, we have all the prerequisites before mounting: the account "human" and password "192.168.1.218" are available, and the 218 host provides ssh access.
Create the "server218" directory and grant it the read and write permissions:
Sudo mkdir/mnt/server218
Sudo chmod 777/mnt/server218
Start mounting:
Sshfs human@192.168.1.218:/home/ /mnt/server218/
Sshfs username @ remote host IP address: local mount point of the remote host path # Usage description
Enter the password of the human account of host 218 at the prompt. the mounting is successful!
Open local/mnt/server218 now and check out, Oh, yeah! This is the home directory of the 218 host. now you can create, copy, paste, and delete files in the directory, just like your own hard disk!
Uninstall:
Fusemount-u mount_point
Fusemount-u local Mount Directory # Uninstall command
5. follow-up questions:
The above operations (except the installation of software) are used in non-sudo environments for common users, which is very convenient. However, I also found some problems during the use process, for example, if the remote host loses response and the local Mount point becomes stuck and affects the use of the local system, you need to manually find the sshfs process and kill it, resulting in slow operation response due to network speed problems, etc, however, it is not common in stable and fast networks. it is acceptable for its powerful functions.