我們需要使用winscp, 在此download:
http://winscp.net/download/winscp405setup.exe
首先我們需要確定SSH Server(本文以OpenSSH為例)已經打開相關的功能.
不同的系統設定檔位置可能有所不同, 但所需修改檔案為 sshd_config.
將sshd_config以下設定打開:
Protocol 2
RSAAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
ChallengeResponseAuthentication no
PasswordAuthentication no
RhostsRSAAuthentication no
其餘保留預設值.
接著, 要在Server端做一個Public Key及一個Private Key:
ssh-keygen -b 1024 -t rsa
檔案名預設為id_rsa, 用預設便可以, 接著, 要輸入Passphrase (即password).
輸出檔案後, 可以到你的用戶目錄中找一個叫 ".ssh" 的Folder, 進入".ssh"後,
我們做一個叫authorized_keys的file:
cat id_rsa.pub >> authorized_keys
然後, 我們將id_rsa抓下來到用戶端, 因WinSCP所用的是Putty的解碼,
所以需要由標準的轉為Putty用的Key File:
1. 打開Putty Key Generator
2. Conversion -> Import Key
3. Save Private
4. 完成此部分!
最後, 到WinSCP部分:
1. 打開WinSCP
2. 選Session, 輸入好Server端的資料
3. 瀏覧Private Key File
4. 選擇已轉好的Private Key File
5. Login
6. 輸入Login
7. 輸入Passphrase
完成!
沒有留言:
張貼留言