- 打開PuTTYgen
- 點擊Generate,同時晃動鼠標,要不然進度較慢
- 保存好公鑰和私鑰的內容(私鑰密碼設置,非必選)
- 服務器上保存公鑰
[root@localhost ~]# mkdir /root/.ssh
[root@localhost ~]# chmod 700 /root/.ssh
[root@localhost ~]# vi /root/.ssh/authorized_keys
把生成的公鑰內容粘貼進去
保存退出
- 關閉selinux
[root@localhost ~]# setenforce 0
關閉putty當前終端
- 設置putty
設置私鑰路徑
保存
重新連接服務器