Shfs

出自 Arch Linux 中文维基

本文內容或本節內容已經過期。

原因: 請提供模板的第一個位置參數以概括原因。 (在Talk:Shfs討論)

本頁面正在考慮歸檔

原因: shfs is probably not relevant anymore(在 Talk:Shfs 中討論)

Shfs是一個簡單易用的Linux內核模塊。該模塊可以讓你通過ssh連接掛載遠程文件系統。使用shfs訪問遠程文件就和訪問本地文件一樣,但其訪問權限由ssh安全傳輸功能進行管理。

注意: 由於shfs自2004年後就再也沒有更新過,目前基於FUSE的SSHFS應用更加廣泛。

安裝[編輯 | 編輯原始碼]

安裝shfs-utils軟件包。

警告: 要使用shfs,需要在客戶端而不是服務器端進行安裝及配置。服務器端只需要運行ssh服務即可。

配置[編輯 | 編輯原始碼]

本文或本章節的事實準確性存在爭議。

原因: Do not simply recommend setting the SUID bit on a binary since this can have severe security implications(在 Talk:Shfs 中討論)


如果想作為普通用戶使用shfs掛載功能,你需要使用chmod +s /usr/bin/shfsmountchmod + /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

參考[編輯 | 編輯原始碼]