Linux使用sshfs挂载远程目录到本地

1安装sshfs

[root@iZwz9hy7gff0kpg1swp1d3Z ~]# yum install sshfs

2创建本地目录

[root@iZwz9hy7gff0kpg1swp1d3Z ~]# mkdir /lys

[root@iZwz9hy7gff0kpg1swp1d3Z ~]# chmod 777 /lys/

3挂载远程目录到本地

[root@iZwz9hy7gff0kpg1swp1d3Z ~]# sshfs 远程服务器的登录名@远程服务器的ip:/home/img lys/

需要输入远程用户的密码

4卸载远程的文件系统

[root@iZwz9hy7gff0kpg1swp1d3Z ~]# umount /lys/

挂载时出现的问题:

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

使用命令:

sshfs root@101.132.36.35:/home/img /lys -o nonempty

原文地址:https://www.cnblogs.com/james-roger/p/7808588.html