Shfs (简体中文)
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Shfs是一个简单易用的Linux内核模块。该模块可以让你通过ssh连接挂载远程文件系统。使用shfs访问远程文件就和访问本地文件一样,但其访问权限由ssh安全传输功能进行管理。
注意: 由于shfs自2004年后就再也没有更新过,目前基于FUSE的SSHFS应用更加广泛。
安装
安装shfs-utils软件包。
警告: 要使用shfs,需要在客户端而不是服务器端进行安装及配置。服务器端只需要运行ssh服务即可。
配置
如果想作为普通用户使用shfs挂载功能,你需要使用chmod +s /usr/bin/shfsmount
和chmod + /usr/bin/shfsumount
两条命令。为了更方便地使用shfs,可以在/etc/fstab
中增加挂载项,例如:
remoteuser@Server:/data /mnt/data shfs rw,noauto,uid=localuser,persistent 0 0 remoteuser@Server:/crap /mnt/crap shfs rw,noauto,uid=localuser,persistent 0 0 remoteuser@Server:/backup /mnt/backup shfs rw,noauto,uid=localuser,persistent 0 0 remoteuser@Server:/home /mnt/home shfs rw,noauto,uid=localuser,persistent 0 0
使用SSH keys可以免去输入密码的步骤。
你可能需要在挂载项中添加端口号(port=<端口号>
)
添加fstab挂载项
如要在fstab添加shfs卷,在/etc/fstab
中按以下格式增加内容:
userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0