使用sshfs挂载远程服务器上的目录

sshfs通过ssh协议,把远程服务器上的目录挂载到本地。

0. 安装sshfs

在macOS下用homebrew安装

$ brew install Caskroom/cask/osxfuse
$ brew install homebrew/fuse/sshfs

其他系统请自行搜索。

1. 使用

挂载目录:

$ sshfs user@hostname:path mount_point

例如挂载192.168.0.1服务器上的/home目录到本地~/remote

$ sshfs liuweijie@192.168.0.1:/home/ ~/remote

使用完以后卸载

$ umount mount_point

例如

$ umount ~/remote

猜你喜欢

转载自blog.csdn.net/autoliuweijie/article/details/55506809