# putty免密登入 (HW04) ### **1. 下載putty和puttygen(免安裝)** https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html 下載putt.exe  下載puttygen.exe  ### **2. 生成金鑰** 開啟puttygen,並按下Generate  移動滑鼠,生成金鑰  金鑰成功生成  ### **3. 將公鑰複製到linux伺服器** 框選公鑰,並複製  新增文字文件,儲存公鑰(無須副檔名)   上傳公鑰至linux伺服器 `scp -P {port} {filename(本地端)} {username}@{ip}:{filename(伺服器端)}`  開cmd,登入linux伺服器 `ssh {username}@{ip}`  新增名為.ssh的目錄 `mkdir .ssh`  將上傳的公鑰複製到.ssh的目錄下 `cp {filename} {(絕對)路徑}`  * 公鑰的位址和檔名固定為~/.ssh/authorized_keys ### **4. 儲存私鑰** 按Save private key  私鑰的副檔名為.ppk  ### **5. putty自動登入設置** 開啟putty,在Connection/SSH/Auth/Gredentials裡,Private key file for authentication選取私鑰的檔案  在Connection/Data裡,Auto-login username輸入用戶名稱  回到Session裡,輸入ip、port,並在Saved Sessions給免密登入帳號一個名稱,最後按Save  ### **6. 登入** 按Open或雙擊免密登入帳號名稱  * 學號: 1084955 ( stu1084955 ) * hostname : HW04 ### **參考資料** * http://blog.kejyun.com/2012/11/setting-ssh-key-to-achieve-non-password-login-on-ubuntu.html * https://crowsnest1217.com/%e5%ad%b8%e7%bf%92%e8%88%87%e5%88%86%e4%ba%ab/windows%e4%bd%bf%e7%94%a8ssh%e9%87%91%e9%91%b0%e5%85%8d%e5%af%86%e7%a2%bc%e7%99%bb%e5%85%a5linux.html * https://www.puttylink.com/putty-login-without-password.html * https://xenby.com/b/220-%e6%95%99%e5%ad%b8-%e7%94%a2%e7%94%9fssh-key%e4%b8%a6%e4%b8%94%e9%80%8f%e9%81%8ekey%e9%80%b2%e8%a1%8c%e5%85%8d%e5%af%86%e7%a2%bc%e7%99%bb%e5%85%a5
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up