创建如下文件
~/.ssh/config
内容
Host
HostName
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
Host
HostName
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
Host
HostName
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
~/.ssh/privateKeyFile 对应私钥在本地的位置。