Git push prompt Permission denied (publickey)

Environment:

  • Windows 10 system;

I have a github.com account and a gitlab.com account. The configuration on the Windows system is as follows:

clipboard.png

rxwangwb_rsagithubgitlab_rxwangwb_rsagitlabconfig:


githubgitlab
gitlab push:

clipboard.png

:

clipboard.png

the submission is successful, but the next time the code is submitted, it will still be rejected. Each time eval (ssh-agent) -> ssh-add -> git push is required. How to solve this problem?

Apr.11,2021

git push has two data protocols: ssh and http .

the subject can first try the http method to see if it succeeds. Just change the remote address to http in git config .

if possible, guess that the ssh server of gitlab (there should be a known_hosts file) did not save your client public key file, resulting in ssh-add for every connection.


set SSH keys try https://github.com/settings/keys
gitlab is the same setting
this should be a better way to deal with


this problem has been solved. Add the executed command to D:\ Programs\ Git\ etc\ bash.bashrc in the Git installation directory,

-sharp add github_cobcmw
eval $(ssh-agent)
ssh-add ~/.ssh/rxblog_rsa

for more information, please see when solving multiple accounts of Windows platform git, the eval $(ssh-agent) problem is always required

= Update on June 11, 2019 =

provides another more friendly solution: the same computer configures multiple ssh keys for different Github or Gitlab accounts ;

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd2343-30dea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd2343-30dea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?