打開終端,輸入命令 $ ssh-keygen 一路按回車,將在~/.ssh 目錄下生成密鑰對。 id_rsa 是私鑰 id_rsa.pub 是公鑰 可以使用以下命令查看公鑰的內容 cat ~/.ssh/id_rsa.pub