【Git】It is also possible that a host key has just been changed. The fingerprint for the ECDSA key解决

今天提交代码,pull的时候.出现IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!

的错误信息.

root@ubuntu:/home/python/Desktop/xxx/xxx/xxx# git pull origin dev
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:u6OmG6qR+1QBAdu32XELsrwwva30N0VBFrGEFTZN+0E.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
  remove with:
  ssh-keygen -f "/root/.ssh/known_hosts" -R 172.xx.x.xxx
ECDSA host key for 172.xx.x.xxx has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

正好在提交前,听到了老大和一个同事聊天,大概就是因为git服务器重做了系统,所以key不一样了,需要重新弄一个.

执行一下删除key:

rm -f  /root/.ssh/known_hosts 
root@ubuntu:/home/python/Desktop/xxx/xxx/xxx# git pull origin dev
The authenticity of host '172.xx.x.xxx (172.xx.x.xxx)' can't be established.
ECDSA key fingerprint is SHA256:u6OmG6qR+1QBAdu32XELsrwwva30N0VBFrGEFTZN+0E.
Are you sure you want to continue connecting (yes/no)? yes # 这里yes
Warning: Permanently added '172.xx.x.xxx' (ECDSA) to the list of known hosts.   
[email protected]'s password: 

让输入密码了,估计是可以了..
pull是可以了,push又不行了….

root@ubuntu:/home/python/Desktop/osgds/Operation/opsapp# git push origin dev
rd@172.xx.x.xxx's password: 
对象计数中: 10, 完成.
Delta compression using up to 2 threads.
压缩对象中: 100% (10/10), 完成.
写入对象中: 100% (10/10), 2.66 KiB | 0 bytes/s, 完成.
Total 10 (delta 7), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To [email protected]:/git/xx.git
 ! [remote rejected] dev -> dev (unpacker error)
error: 无法推送一些引用到 'rd@172.xx.x.xxx:/git/xx.git'

百度了下,说是权限问题..给老大说了一声,他估计是改了下设置,可以正常提交了.

你可能感兴趣的:(Git,SSH)