close

 

如果真的必須要把 linux 暴露在 internet 上
使用 ssh key 登入某種程度來說要比帳號密碼驗證來的安全多
我們可以藉由修改 /etc/ssh/sshd_config 關閉密碼驗證來限制只允許使用  ssh key 登入
PasswordAuthentication no
修改完後記得重新啟動 sshd

在 linux 上可以簡單用 ssh-keygen 產生 id_rsa 
並且用  ssh-copy-id 把 authorized_key 送上遠端 server: ~user/.ssh/ 中

但是如果要在一台 windows client 透過 putty 的話
就要先下載 puttygen 
1. 開啟 putty key generator
2. 點選上方 conversions - import key
3. 選擇 linux ssh-keygen 產生的 id_rsa
4. 如果有密碼的話,輸入密碼
5. save private key

undefined
鳥哥的Linux私房菜:伺服器架設篇(第三版)(附光碟)

arrow
arrow

    helloworld 發表在 痞客邦 留言(0) 人氣()