Git/Gerrit suggests "Permission denied (publickey).)"

question

The Git/Gerrit project has opened permissions, and ssh-keygen has also been generated and configured, but it still cannot be used normally, prompting " Permission denied (publickey)."

reason

Since OpenSSH has abandoned the rsa encryption key for security reasons since version 8.8, because OpenSSH believes that the cost of rsa cracking is less than 50,000 US dollars, it feels that the cost is too small, and it is disabled if there is a risk.

Use the command: ssh -v [git server address] to view the OpenSSH version number of the Gerrit server. like:

ssh -v 10.0.10.208

Here, if the openssh version number is ≥8.8, you can use this method.

Solution

Enter the .ssh directory of the machine, and create a new config file below without the suffix name:

Open config and add at the end:

Host gerrit.xxxxx.com
HostName gerrit.xxxxx.com
User Gerrit用户名(例如:test)
PubkeyAcceptedKeyTypes +ssh-rsa
IdentityFile ~/.ssh/id_rsa
Port 29418(Gerrit端口)

After configuring clone, the problem is solved.

Guess you like

Origin blog.csdn.net/u013015629/article/details/129120225