sshfs的使用

2017-11-27  本文已影响0人  发条蛙

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

解决方案如下:

  1. 将当前用户加入到fuse组:
    addgroup clockfrog fuse
    
  2. 修改文件/etc/fuse.conf,加入如下内容:
    mount_max = 1000
    user_allow_other
    
  3. 重新登录系统即可挂载:
    sshfs -o allow_other leon@192.168.253.81:/opt/leon /home/clockfrog/mp_81
    
  4. 卸载命令如下:
    fusermount -u /home/clockfrog/mp_81
    

Trouble Shooting

Transport endpoint is not connected

  1. 出现如下问题:
    Transport endpoint is not connected
    
  2. 则可以先卸载再重新挂载:
    umount -l /home/clockfrog/mp_81
    fusermount -u /home/clockfrog/mp_81
    
  3. 可以使用如下命令进行调试:
    sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 leon@192.168.253.81:/opt/leon /home/clockfrog/mp_81 -p 22 -C
    
上一篇 下一篇

猜你喜欢

热点阅读