Follow me on GitHub

Linux/Mac 挂载远程服务器目录到本地

1. 安装

sudo apt-get installsshfs

 

2. 创建SSHFS 挂载目录

sudo mkdir/mnt/siyuan

 

3.使用SSHFS 挂载远程的文件系统

sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa #username@site:/share1/home/siyuan /mnt/siyuan

例:

sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa siyuan@uestc.site:/share1/home/siyuan  /mnt/siyuan

sshfs -C -o reconnect #username@site:/share1/home/siyuan ~/mnt/siyuan

例:

sshfs -C -o reconnect siyuan@uestc.site:/share1/home/siyuan ~/mnt/siyuan

 

4. 卸载远程的文件系统

sudo umount/mnt/siyuan

 

 

posted @ 2019-04-11 08:39  SiyuanChen  阅读(3216)  评论(0编辑  收藏  举报