我正在尝试在詹金斯从事多部门工作。代码放在git中。在执行任务时,我遇到了访问权限问题。在jenkins中生成ssh-keygen
时,出现权限被拒绝错误。
在Ubuntu框中配置。
git ls-remote -h git@github.com:****/*****1.git HEAD
The authenticity of host 'github.com ("IP Address")' can't be established.
RSA key fingerprint is SHA256:********************Y8.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/lib/jenkins/.ssh/known_hosts).
Load key "/var/lib/jenkins/.ssh/id_rsa": Permission denied
Permission denied (publickey).
fatal: Could not read from remote repository.
答案 0 :(得分:0)
Load key "/var/lib/jenkins/.ssh/id_rsa": Permission denied
与读取本地文件系统上的本地ssh私钥有关,与远程服务器无关。
确保您已拥有ssh密钥的读取权限。 (当我的密钥由Windows主机加密但我的Docker容器无法解密时,我遇到了这个问题。)
您还可以始终只生成一个新密钥并尝试使用该密钥。