linux 安装sshfs_如何在Linux和Windows上安装SSHFS?

linux 安装sshfs

linux 安装sshfs

SSH is a secure remote connection protocol used to manage and get a shell from remote systems. SSH is mainly used by Linux distributions. SSH also provides a secure file share over the network which is names as SSHFS.

SSH是一种安全的远程连接协议,用于管理远程系统并从中获取外壳程序。 SSH主要由Linux发行版使用。 SSH还通过网络提供安全文件共享,名称为SSHFS。

为Linux安装SSHFS客户端 (Install SSHFS Client For Linux)

SSHFS is named as file system. We need to install SSHFS file system package for Linux systems.

SSHFS被命名为文件系统。 我们需要为Linux系统安装SSHFS文件系统软件包。

Ubuntu,Debian,Mint,Kali (Ubuntu, Debian, Mint, Kali)

$ sudo apt install sshfs
Install SSHFS Client For Linux
Install SSHFS Client For Linux
为Linux安装SSHFS客户端

CentOS,Fedora,RedHat (CentOS, Fedora, RedHat)

$ sudo yum install sshfs

为Windows安装SSHFS客户端 (Install SSHFS Client For Windows)

Windows provides different 3rd party applications those supports SSH and SSHFS. Here a list of them.

Windows提供了支持SSH和SSHFS的不同的第三方应用程序。 这里是他们的清单。

  • WinSCP

    WinSCP
  • SSHFS

    SSHFS
  • Dockany

    码头

In this tutorial, we will use the most popular one WinSCP. WinSCP can be downloaded from the following link and installed by Next->Next fashion.

在本教程中,我们将使用最受欢迎的WinSCP 。 可以从以下链接下载WinSCP,并通过Next > Next fashion安装。

https://github.com/dokan-dev/dokany/releases/download/v1.0.1/DokanSetup.exe

https://github.com/dokan-dev/dokany/releases/download/v1.0.1/DokanSetup.exe

https://github.com/Foreveryone-cz/win-sshfs/releases/download/1.6.1/WinSSHFS-1.6.1.13-devel.msi

https://github.com/Foreveryone-cz/win-sshfs/releases/download/1.6.1/WinSSHFS-1.6.1.13-devel.msi

挂载Linux (Mount For Linux)

Linux can mount SSHFS file systems in different ways. In this part, we will use sshfs command directly. We will provide the remote system IP address or hostname with the path we want to mount. We will also provide the local path we want to mount to. We can also use options about the SSHFS file system.

Linux可以通过不同方式挂载SSHFS文件系统。 在这一部分中,我们将直接使用sshfs命令。 我们将为远程系统IP地址或主机名提供要安装的路径。 我们还将提供要挂载到的本地路径。 我们还可以使用有关SSHFS文件系统的选项。

$ sudo sshfs [email protected]:/home/ismail /mnt

We will use sudo in order to mount to the /mnt. We will also provide remote user which is ismail in this case.

我们将使用sudo来挂载到/mnt 。 在这种情况下,我们还将提供ismail远程用户。

列出SSHFS挂载 (List SSHFS Mounts)

We can list all ready mounted SSHFS file systems with the mount command. We will filter with the grep file like below.

我们可以使用mount命令列出所有已安装的SSHFS文件系统。 我们将使用grep文件进行过滤,如下所示。

$ mount | grep sshfs
List SSHFS Mounts
List SSHFS Mounts
列出SSHFS挂载

允许其他人读写SSHFS(Allow Others To Read and Write For SSHFS)

One of the most faced problems is writing to the SSHFS mounted directories. Because during mount we use sudo which will mount with the root privileges. This will cause other users cannot read or write to the mounted directories. We can use -o option with the allow_other to enable to read and write to the SSHFS mounted directories.

最面临的问题之一是写入SSHFS安装目录。 因为在挂载期间我们使用sudo ,它将以root特权挂载。 这将导致其他用户无法读取或写入安装的目录。 我们可以将-o选项与allow_other一起使用,以启用对SSHFS安装目录的读写操作。

$ sudo sshfs -o allow_other [email protected]:/home/ismail /mnt

提供SSH私钥进行身份验证 (Provide SSH Private Key For Authentication)

SSHFS service is provided over SSH port and uses SSH for authentication. SSH can authenticate users in different ways like password, private key etc. We can use a certificate in order to authenticate the user. In this example we will use IdentityFile option with the certificate path.

SSHFS服务通过SSH端口提供,并使用SSH进行身份验证。 SSH可以通过不同的方式(例如密码,私钥等)对用户进行身份验证。我们可以使用证书来对用户进行身份验证。 在此示例中,我们将使用IdentityFile选项和证书路径。

$ sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa [email protected]:/home/ismail /mnt

Windows安装 (Mount For Windows)

We will just provide the IP address or Host name, username and password for the SSHFS mmount. We can also change the drive letter where the remote system will be mount.

我们只提供SSHFS挂载的IP地址或主机名,用户名和密码。 我们还可以更改将挂载远程系统的驱动器号。

LEARN MORE  How To Recover Data with ddrescue Command?
了解更多信息如何使用ddrescue命令恢复数据?
Mount For Windows
Mount For Windows
Windows安装

UnMount对于Linux(UnMount For Linux)

We can unmount the SSHFS file system for Linux distributions. We just need to provide the path we have already mounted. In this example, we will unmount from /mnt with the umount command. Keep in mind that the mounted path shouldn’t be in use.

我们可以卸载Linux发行版的SSHFS文件系统。 我们只需要提供已经安装的路径即可。 在此示例中,我们将使用umount命令从/mnt umount 。 请记住,不应使用已安装的路径。

$ sudo umount /mnt
 

翻译自: https://www.poftut.com/how-to-mount-sshfs-on-linux-and-windows/

linux 安装sshfs

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值