报错:Permission denied (baas,keyboard-interactive,publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
思路:SSH公钥问题
- 每个用户在公共开发机生成一对自己专属的SSH密钥,用-f参数指定你的密钥对的位置把下面例子中的XXX换成自己的账户,一路回车
- ssh-keygen -t rsa -f ~/.ssh/id_rsa.XXXX
- SSH pass:XXXX
显示如图 表示密钥对生成成功
在~/.ssh/config配置文件中指定你的密钥地址。按下面方式配置config文件,就能实现不同用户使用不同的密钥
cd ~/.ssh
vi config //没有config文件时此命令会新建config,将以下三行添加到config文件内
Host XXX.com
User XXX
IdentityFile ~/.ssh/id_rsa.XXX
- 配置完成后 将公钥配置到目标环境上
- Cat ~/.ssh/id_rsa. XXX.pub
添加SSH Keys
Git clone验证