Shfs
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