简体   繁体   中英

Only one user can push/pull to github

I have two CentOS servers that are set up the same. I created a git repo on server A and pushed it to github. I then cloned the repo on server B. At first, all seemed to be in order. I could commit on either server, push to the remote, and the pull on to the other server.

The problem is that my co-workers now cannot push or pull on server B (they can run git status or commit). Strangely, this applies to ALL repos on server B, not just the one I cloned. Here is the error they see:

ERROR: Repository not found.
fatal: Could not read from remote repository.

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

I checked that they are in the collaborators lists (both as owners and on the team assigned to the repo).

I also tried changing to the root user and cloning the repo again--as root I received the same error as above. The global .gitconfig does not reference my user or key, and the local .git/config files are set to use SSH (git@github.com).

What would cause this error to happen all users but one? Where else should I be looking?

在运行git命令时向其添加'-v'以获得更详细的输出,这应该告诉您什么地方不对。

I did resolve this issue. I found the problem by running ssh -T -vvv git@github.com which showed different keys being used for my user vs. the other users on the server. The key being used generally was not tied to a user in our github account. The fix:

  • Generated a new SSH key
  • Added key to shared user on github account
  • Updated .ssh/config to use the new key when accessing github.com

I am not certain how the SSH key got messed up, because it worked before. But this fixed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM