生成密钥 cat ~/.ssh/id_rsa.zhaozhenjie.pub 配置config 创建文件 如果已经存在的用户在末尾追加 touch ~/.ssh/config && chmod 644 ~/.ssh/config vim 进行编辑(指定主机 用户名 公钥文件) Host xxxx.xxxx.com User zhaozhenjie IdentityFile ~/.ssh/id_rsa.zhaozhenjie git clone 成功