0

I am making my portfolio following the video https://www.youtube.com/watch?v=0fYi8SGA20k&t=1827s No instructions were soo far given for pushing the code. I created a new rope on github and followed "or push an existing repository from the command line instruction" .. but when i tried pushing the code i got this error

git branch -M main
git push -u origin main
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
 --xxxxx------
Please contact your system administrator.
Add correct host key in /Users/arundhati/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/arundhati/.ssh/known_hosts:1
RSA host key for github.com 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.

im not sure what to do by Add correct host key in /Users/arundhati/.ssh/known_hosts to get rid of this message. and is it something dangerous?

  • You need to delete the line that contains the key in that file. From the error message it looks like line 1 but read the file and make sure it's the key to github. Once it's deleted, the next time you try to pull or push to github you will be asked if you trust the website and you can just answer yes/y – slebetman May 10 '23 at 17:46
  • @slebetman its in my code>????? im sorry if this is silly question but im new to this – traveller12 May 10 '23 at 17:47
  • The file mentioned in the error message. Read error messages, don't just gloss over them assuming you don't understand anything. Just like a school textbook, if you try to read it you will find stuff you can start to understand. It is telling you that the current public key of github does not match the one ssh stores in the file `/Users/arundhati/.ssh/known_hosts` at line number 1. Delete that line and let ssh configure the key again by doing another git pull or git push. – slebetman May 11 '23 at 02:59
  • The purpose of ssh remembering the public key of servers is to detect impostors. For example if a hacker were to set up a server that looks like your server in order to trick you to connect to it ssh will compare the key it knows with the key the server uses. If there's a mismatch ssh will warn you: "Are you sure you are connecting to the right server?" If you are sure you can just tell ssh yes it's OK – slebetman May 11 '23 at 03:02

0 Answers0