Github asks to enter username and password when downloading files

reason

There are two ways to download code from github, SSH and http. If you have set up an SSH key (please refer to https://blog.csdn.net/u013778905/article/details/83501204 ), you can use the first way. If not, use the second method. One problem is that when I use git clone to download both links, it pops up and asks me to enter my username and password. This is very troublesome. And when I use http to download, I obviously entered the correct user name and password, but he still can't download, I don't know why? But you can use the SSH link to enter the username and password. After setting the SSH key, do you have to use the SSH link to download? Guys please explain.
insert image description here
insert image description here

Solution

Delete the password of the key. Enter ssh-keygen -p, press Enter, Enter file in which the key is (/c/Users/chen/.ssh/id_rsa): appears, press Enter, you will be asked to enter the old password, Enter old passphrase: enter the password Then press Enter (note that the same character will not be displayed on the screen when typing, don't worry, it has already been entered). Enter new passphrase (empty for no passphrase): will appear again, note that here, press Enter directly, indicating that no password is required. Enter same passphrase again: pops up again, and press Enter directly. If Your identification has been saved with the new passphrase. appears, it means that the password has been changed successfully, that is, no password is required. Now you don't need to enter a password to download the code.

have a test

This time, you don't need to enter the password, you can download it directly. Therefore, it is recommended that you do not need to set a password when setting the SSH key in order to avoid trouble. I just set a password because I don't know it.
insert image description here

Guess you like

Origin blog.csdn.net/weixin_42999968/article/details/126261811