沉冰浮水

沉冰浮水

做最终到的事,成为最终成为的人!
github
bilibili
mastodon
zhihu
douban

"VSCode Notes" Git: Host key verification failed

I have been using the TortoiseGit tool to operate Git, but switching back and forth between windows feels cumbersome when using VSCode's built-in support.

Today, I finally tried to commit and push using VSCode, but encountered the following error message:

Git: Host key verification failed

It may also appear in this form:

Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.

Solution:

Execute the following command:

ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

Source:

ssh - Git error: 'Host Key Verification Failed' when connecting to remote repository - Stack Overflow


Failed to authenticate git remote

Or

Permission denied (publickey).

It is recommended to use SSH authentication.

  1. Change the remote address to [email protected]:wdssmq/HelloZBlog.git format.

  2. Open Git Bash and execute:

cd ~/.ssh
ssh-keygen -t ecdsa
# Display the path of the .ssh folder
pwd
# c/Users/Username/.ssh
  1. Find id_ecdsa.pub in the corresponding path and open it with an editor. Copy the content and add it to your GitHub account.

You can click the link to add it directly:

Add new SSH keys: https://github.com/settings/ssh/new

After that, you can perform commit operations in VSCode.


ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type

Solution:

The RSA algorithm is considered insecure (mainly depending on the key length).

A more direct method is to change the algorithm to ecdsa or ed25519, with the latter being more secure. However, if you encounter the prompt unknown key type ed25519 in an older environment, choose the former.

ssh-keygen -t ed25519
# unknown key type ed25519
ssh-keygen -t ecdsa

Related:

【Memo】msysGit Installation and Usage

【VSCode】Shortcut Key Memo

Press ctrl + shift + g to switch to Git management.

【Exploration】VSCode Remote Development Configuration

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.