参考:https://developer.aliyun.com/article/1599623
https://blog.csdn.net/jacke121/article/details/143928971
首先在你本地的的命令行中生成一个私钥(id_rsa)和一个公钥(id_rsa.pub)
输入以下代码,一路回车到最后即可
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
一般路径在~/.ssh/id_rsa
,~/.ssh/id_rsa.pub
找到~/.ssh/authorized_keys
文件并编辑,将~/.ssh/id_rsa.pub
内容复制另起一行追加到末尾
打开ssh配置文件(一般是~/.ssh/config
),在配置块中添加 IdentityFile ~/.ssh/id_rsa
示例:
Host esxi-GO-NODE-builder
HostName 192.168.3.175
User root
IdentityFile ~/.ssh/id_rsa
正在学习Go语言的PHP程序员。