沉冰浮水

沉冰浮水

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

"VSCode Notes" Git: Host key verification failed

I have been using the TortoiseGit tool to operate Git, but switching windows back and forth with the built-in support in VSCode feels quite awkward.

Today, I finally tried to commit and push using VSCode for the first time, but I received an 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
# List the path of the .ssh folder
pwd
# c/Users/username/.ssh
  1. Find id_ecdsa.pub in the corresponding path, open it with an editor, and copy its content to add to your GitHub account.

You can click the link to add 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 no longer secure (mainly depending on key length);

A more direct method is to change the algorithm to ecdsa or ed25519, with the latter being more secure. However, if your environment is older and you receive the unknown key type ed25519 message, then choose the former;

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

Related:

Memo: msysGit Installation and Usage

VSCode Keyboard Shortcuts Memo

You can switch to Git management with ctrl + shift + g.

Struggles: VSCode Remote Development Configuration

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