sshfs掛載與ssh無密碼登入

來源:互聯網
上載者:User

最近架設了一台外網伺服器,專門用於bt、電驢的下載。原先使用samba服務進行檔案訪問,後來發現,Linux下訪問samba服務太慢,百兆鏈路,只有幾百KB/s的速度。經推薦,開始使用sshfs,速度很快,速度經常能上10MB/s。
安裝 emerge sshfs-fuse
使用 mkdir mountpoint
sshfs [remote_user]@[remote_server]:[remote_directory] [mountpoint] -o allow_other
也可以自動掛載,主要分兩步
1、設定對遠程伺服器的無密碼登入

如圖所示,無密碼ssh登入的基本原理是,在本地的root使用者下,用ssh-keygen命令產生一對密鑰,然後將其中的公開金鑰,追加到遠程伺服器的authorized_keys檔案中即可。金鑰組只對本地的產生使用者有效,其他使用者需要重建並添加。命令如下: ssh-keygen -t rsa
cat .ssh/id_rsa.pub | ssh [remote_user]@[remote_server] "cat - >>.ssh/authorized_keys"
2、修改fstab
如下添加一行: sshfs#[remote_user]@[remote_server]:[remote_directory] [mountpoint] [mountpoint] fuse allow_other 0 0
參考文檔:
《Linux實現無密碼登入》
番外篇:
windows的sshfs
windows的sshfs是以dokan library+dokan sshfs的形式實現的。
訪問這裡: Dokan:http://dolan-dev.net/en/download/
依次下載安裝: Microsoft Visual C++ 2005 SP1 Redistributable Package dokan-0.5.2 dokan-sshfs-0.2.0.1226 dokan-sshfs-for-dokan-050.zip
即可

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.