Friday, January 6, 2017
關於Debian putty+ssh 出現server refused our key問題
這大概非遇到不可?
怎麼印象中不管是裝哪個linux distribution....都會發生一次?
教學雖然成山的多,還是來記錄一下
主要是想以PuTTY用SSH來登入Linode的linux 虛擬主機
1. puttygen.exe產生 public key, private key,選擇SSH2-RSA,並將 Number of bits改成1024
2.輸入Key passphrase 後按Save private key,儲存私鑰
3.至linux server 放上public key
mkdir ~/.ssh
chmod 700 ~/.ssh
vi ~/.ssh/authorized_keys
貼上 public key
4.修改權限
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
5.重啟SSH
service ssh restart
6.設定PuTTY,SSH -> Auth將Private key file for authorization指定為步驟2儲存的私鑰
此次遇到主要問題是紅字的2個部分
久久用一次都會忘記...要改成1024@@?
權限的話,許多教學都寫authorized_keys權限要改成600的說?.....
參考資料如下:
https://www.howtoforge.com/ssh_key_based_logins_putty
http://askubuntu.com/questions/306798/trying-to-do-ssh-authentication-with-key-files-server-refused-our-key
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment