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

[Solved] Git Clone Error: Please make sure you have the correct access rights and the repository exists.

git clone [email protected]:mypy/testproject.git


Cloning into 'testproject'...
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

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

When it is determined that the SSH key has been configured on the server side, but still cannot be cloned, the following reasons need to be analyzed:

Execution:

ssh -Tvvv [email protected]

....
debug1: Connecting to test.com[36.99.xxx.xx] port 22.
....

During git clone, SSH protocol is used to connect the server and the default port 22 is used. When the company uses intranet penetration software such as NPs or FRP to map out, the intranet server does not use the standard port 22, so the port needs to be specified during git clone

git clone ssh://[email protected]:22222/mypy/testproject.git

Please make sure you have the correct access rights and the repository exists. The problem has been solved when Git clone appears.

After reading a lot of information, I finally figured out the error of the clone command in git. Don’t talk nonsense and go directly to the steps. I hope it will be helpful to everyone.

1 Delete known_hosts under the .ssh folder (search the folder directly) (delete manually, no need for git)

2 Open bash.exe in the bin directory of the downloaded Git and enter the command ssh-keygen -t rsa -C “username” (Note: username is your username on git) , if the execution is successful. return:

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): //where username is the user name on the computer, this address is also the storage address of the file, and then we press

Press Enter, if you have a storage address before, it will return /Users/your username/.ssh/id_rsa already exists. Overwrite (y/n)? Directly enter y and press Enter. It will appear if there is no storage address before

Enter passphrase(empty for no passphrase); also directly enter, in both cases Enter same passphrase again will appear after enter, and then enter will display a long list of contents

There are also some codes like ..o.. o oo .oS., which shows that the SSH key has been generated. The file directory is: username/.ssh/id_rsa.pub.

 

3  Then find that the system automatically generates two files in the .ssh folder, id_rsa and id_rsa.pub, open id_rsa.pub with Notepad and copy all the contents.

4  Open https://github.com/, log in to your account, and enter Settings to find

5 Then paste the content you copied into the key

Then click Add SSH Key

ok there is one last step

6 Still enter ssh -T [email protected] in bash.exe and then a bunch of content will pop up. You only need to enter yes and press Enter and you are done, and then he will prompt you that you are successful.

Then you can use the git clone command normally, and finally I wish you good luck haha!

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

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

Questions

After the system is reinstalled, Git is newly installed and you want to download the items on the code cloud through SSH. The result shows that please make sure you have the correct access rights and the repository exists.

Why

Please make sure that you have sufficient access rights and that the warehouse does exist. So there are two possible reasons, one is that the warehouse that the link points to does not exist, the other is that there is not enough access rights
for the first case, check if there are any errors in the input of the link. This paper aims at the second case. After installing git, if you want to download the source code from the code cloud by SSH, you need to generate the public key and bind it with the account on the code cloud

Solutions

There are three steps

the first step is to generate sshkey on the local computer
after entering the following commands on the command line, press enter multiple times:

ssh-keygen -t rsa -C "[email protected]"

Note: in the process of actual operation, the here is used [email protected] replace it with the mailbox bound to your gitee account

Second, bind the generated public key to the code cloud account
log in to the code cloud, click the user’s Avatar on the right side of the top navigation bar, and click Settings - > Security settings - > SSH public key for binding
in Windows system, the default file name of public key file is ID_ RSA. Pub , which is located in the C:// users \ \ your current user name. SSH directory, can be quickly accessed by running % HomePath% \. SSH in the run window

the third step is to confirm and add gitee.com to the local SSH trusted hosts list
execute the following commands on the command line:

ssh -T [email protected]

The system will ask whether to add gitee.com to the list of trusted hosts, enter Yes and press enter

At this point, you can successfully download the project on the code cloud through SSH

For more details, refer to the code cloud official document: generate/add SSH public key

References

Please make sure you have the correct access right and the repository exists or permission De