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 [email protected]:/share1/home/siyuan  /mnt/siyuan

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

例:

sshfs -C -o reconnect [email protected]:/share1/home/siyuan ~/mnt/siyuan

 

4. 卸载远程的文件系统

sudo umount/mnt/siyuan

 

 

转载于:https://www.cnblogs.com/siyuan1998/p/10687476.html

你可能感兴趣的:(运维)