Linux/Mac 挂载远程服务器目录到本地
程序员文章站
2024-01-04 21:06:04
1. 安装 2. 创建SSHFS 挂载目录 3.使用SSHFS 挂载远程的文件系统 sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa #username@site:/share1/home/siyuan /mnt/siyuan 例: sshfs ......
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