7

MacFUSE+sshfs让Mac像管理本地文件一样管理远程服务器文件

 3 years ago
source link: https://xmanyou.com/mac-mount-remote-folder/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
23 February 2021 / mac

MacFUSE+sshfs让Mac像管理本地文件一样管理远程服务器文件

想要从Mac开发机上管理远程服务器的配置文件,如果只是偶尔修改一下,可以利用scp来进行文件更新。

但是,如果要频繁修改,或者要修改一整个文件夹,就有点不那么方便了。

有一个方案是:将远程服务器的目录,映射到本地,然后就可以像编辑本地文件一样进行操作了。

要映射远程文件夹,需要两个工具:

    1. MacFUSE
    1. sshfs

这两个文件都可以从osxfuse网站上下载: https://osxfuse.github.io/

MacFuse-sshfs-mount-remote-folder-01

安装 MacFUSE

MacFuse-sshfs-mount-remote-folder-02

MacFuse-sshfs-mount-remote-folder-03

安装完后,可以在系统设置里找到MacFUSE
MacFuse-sshfs-mount-remote-folder-04

检查一下是否是最新版本
MacFuse-sshfs-mount-remote-folder-05

安装sshfs

MacFuse-sshfs-mount-remote-folder-08

使用sshfs映射远程文件夹

  • 1). 映射文件夹
sshfs <用户名>@<服务器>:<服务器上的绝对路径> <本地目标文件夹> -ovolname=<映射后的文件夹名称>

如果没有提供-ovolname参数,则会使用系统参数
MacFuse-sshfs-mount-remote-folder-06

建议提供-ovolname参数,这样在finder中,名字会更友好一些:
MacFuse-sshfs-mount-remote-folder-07

  • 2). 取消映射
umount <本地文件夹>

由于新版本Mac系统对于权限控制比较严格,所以MacFUSE和sshfs都需要一些高级权限才可以使用。

阿斌

Read more posts by this author.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK