To mount a remote directory to a local using SSHFS

Source: Internet
Author: User
Tags file transfer protocol

Under Linux we typically use SSH commands to log on to a remote Linux server, and if more than one remote server needs to log in, the process of switching back and forth will become cumbersome. If you use SSHFS, you will be able to map the remote directory directly to the local without modifying the settings of the remote computer. Let's take a look at how to use SSHFS.

First, we need to install the SSHFS software. SSHFS is a file system client based on the SSH file Transfer Protocol, and its official webpage is: http://fuse.sourceforge.net/sshfs.html. Under CentOS, we can install it via Yum (note that installing the Epel source is required for Yum installation):
yum-y Install FUSE-SSHFS
After installation, the system will automatically establish a fuse user group, users who want to use SSHFS simply join this user group.
To mount a remote directory, use the following command:
SSHFS [email protected]:p ath Mout_point
Here user is the remote host username, hostname is the remote host IP address, path is the remote host to mount to the local directory, Mount_point is mounted to the local directory.
When not in use, use the following command to uninstall:
fusermount-u Mount_point
If you want to mount the boot automatically, you can add the following line to the/etc/fstab:
sshfs#[email protected]:p ath Mount_point fuse defaults,auto,allow_other 0 0
This requires that SSH automatic login is configured, so that the root user can log on to the remote host using the user, the other allow_other this parameter is very important, without this parameter, the attached directory only root can access.

To mount a remote directory to a local using SSHFS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.