sshfs可用于将远程目录挂载到本地,在使用之前,需要先进行安装:
aptitude install sshfs
对于非root用于,挂载时会出现如下错误信息:
fusermount: failed to open /etc/fuse.conf: Permission denied
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
解决方案如下:
- 将当前用户加入到fuse组:
addgroup clockfrog fuse - 修改文件
/etc/fuse.conf,加入如下内容:mount_max = 1000 user_allow_other - 重新登录系统即可挂载:
sshfs -o allow_other leon@192.168.253.81:/opt/leon /home/clockfrog/mp_81 - 卸载命令如下:
fusermount -u /home/clockfrog/mp_81
Trouble Shooting
Transport endpoint is not connected
- 出现如下问题:
Transport endpoint is not connected - 则可以先卸载再重新挂载:
umount -l /home/clockfrog/mp_81 fusermount -u /home/clockfrog/mp_81 - 可以使用如下命令进行调试:
sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 leon@192.168.253.81:/opt/leon /home/clockfrog/mp_81 -p 22 -C









网友评论