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