下載puttygen
https://www.puttygen.com/download-putty
產生出來的public key
---- BEGIN SSH2 PUBLIC KEY ---- Comment: "rsa-key-20190610" AAAAB3NzaC1yc2EAAAABJQAAAQEAtOBTilvMlexU6mhYroLhSmWIkg/Y3PprVaGO r7tm7PrScWFGOLUa4hzGTTx1tFl4CnP0rhiJ7cbvhBD6iNfFO2z7GxqMo2nhIOvF 0kejkuKWWsr4yCy9U0NDDLQedYemQvS4XIlULW5h1bLFaOgp+L1FzR75Pn4uFASU rB/4tfMY9v4adkUwMx2829aSwcrRRKt0caQQLHjjjDoFSiZlHy3jNIy6Kakz6aZb 9Xnmt7r78nvUxhjACm4p/MKuWJOFbDqPTATN8eDsztRsADKFXAvG3dMJowh2hiFi p4jf78S1VwfOF4//PRovV5SygPeWTzD1hKZ5pWWsgJwt3rYQDQ== ---- END SSH2 PUBLIC KEY ----
將上面那串更新到 ~/.ssh/authorized_keys 注意只有base64的部分並且要是一整行不能斷行
注意 selinux的設定和 authorized_keys 需要是chmod 600
格式為 options, keytype(ssh-rsa), base64-encoded key(AAAAB3N…), comment (options是可選)
可參考 https://en.wikibooks.org/wiki/OpenSSH/Client_Configuration_Files#~/.ssh/authorized_keys