Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the SSHFS file system to remotely hang a directory over SSH

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares to you is about how to use the SSHFS file system to hang remotely in the directory through SSH, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

SSHFS (SSH Filesystem) is a FUSE-based file system client that connects to remote directories through SSH. SSHFS uses the SFTP protocol, which is a subsystem of SSH and is enabled by default on most SSH servers

Brief introduction

SSHFS (SSH Filesystem) is a FUSE-based file system client that connects to remote directories through SSH. SSHFS uses the SFTP protocol, which is a subsystem of SSH and is enabled by default on most SSH servers

The advantage of SSHFS over other network file systems, such as NFS and Samba, is that it does not require any additional configuration on the server side. To use SSHFS, you only need SSH to access the remote server.

System environment

Cetnos7.7

Windows10

Installation

Centos install SSHFS

[root@localhost] # yum-y install epel-release & & yum-y install sshfs

Windows10 install SSHFS

The latest versions of WinFsp and SSHFS-Win need to be installed

WinFsp download address: https://github.com/billziss-gh/winfsp/releases/

SSHFS-Win download address: https://github.com/billziss-gh/sshfs-win/releases

Mount a remote file system in Centos

SSHFS uses the format:

Sshfs [user@] host: [dir] mountpoint [options]

If no remote directory is specified, the user's home directory is connected by default.

For example, the remote host needs to access root's home directory, where the root user is used for remote access. The mount point uses the / mnt folder here.

[root@localhost ~] # sshfs root@192.168.0.105: / mntroot@192.168.0.105's password:

You will be prompted for a user password. To avoid typing a password each time the remote directory is mounted, you can generate a SSH key and set a password-less login.

If you need to boot and mount automatically, you can add it to the / etc/fstab file:

[root@localhost ~] # echo 'root@192.168.0.105:/Shares / mnt fuse.sshfs defaults 0' > > / etc/fstab

The premise is that you need to set a password-free login, otherwise the boot cannot be mounted.

Unmount the remote file system

[root@localhost ~] # fusermount-u / mnt/ or [root@localhost ~] # umount / mnt

Mount a remote file system in Windows10

The remote directory added by default is the user's home directory.

Right-click this computer-map network drive

Because SSHFS uses the SSH protocol, all data transferred between the server and the client must be encrypted and decrypted. Compared to NFS, this results in slightly slower performance and higher CPU usage on the client and server. Sshfs can be used temporarily to access remote files.

The above is how to use the SSHFS file system to hang the directory remotely through SSH. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report