0

I'm trying to clone my repo into my production ubuntu server machine. When I clone it into my MacBook with https or with SSH everything is ok but when I try to clone it in my ubuntu server it says remote: "HTTP Basic: Access denied". I saw many topics about it on stack overflow but none of the answer worked for me.

I precise it says "remote: HTTP Basic: Access denied" only when I use HTTPS. When I use SSH it freezes then its says 5 min later a time out message. Am I missing something? SSH keys missing? 2FA? why can I clone on my mac and not on my ubuntu server?

Angelo Mendes
  • 905
  • 13
  • 24
Jerem Lachkar
  • 1,008
  • 11
  • 24
  • You need to add the SSH key from your server to your github account. – Cyclonecode May 15 '19 at 17:08
  • I did : I created an SSH key, i put on my server and I added it in the Settings of my gitlab project, but still does not work. How to tell git program on my server the path of the key pair i created ? – Jerem Lachkar May 15 '19 at 17:10
  • and I could still clone on my Macbook without any problem and without adding any ssh key to gitlab... – Jerem Lachkar May 15 '19 at 17:11
  • Are you cloning from the same account which you topk the SSH key from? I mean the key you need to add should be located under ’/home//.ssh’ – Cyclonecode May 15 '19 at 17:12
  • I added the key pairs in another path. How can I tell git program the path of my key ? – Jerem Lachkar May 15 '19 at 17:13
  • The reason that you can clone without any key is perhaps because you have configured git user locally? What does ”git config —list user.email” show you? – Cyclonecode May 15 '19 at 17:15
  • "fatal: not in a git directory" – Jerem Lachkar May 15 '19 at 17:16
  • Try this one as well: https://stackoverflow.com/questions/10054318/how-do-i-provide-a-username-and-password-when-running-git-clone-gitremote-git – Cyclonecode May 15 '19 at 17:17
  • Still same problem .. The answer in this post just gives a shortcut to provide username and password right in the URL. But in my case, they do ask me for mail/passwd but just after I provide they say “remote: HTTP Basic: Access denied” – Jerem Lachkar May 15 '19 at 17:21
  • well then it seems like your user/password is invalid :) – Cyclonecode May 15 '19 at 17:22
  • It is valid lol.. or maybe special chars used in my password are badly encoded and not interpreted by gitlab .... – Jerem Lachkar May 15 '19 at 17:23
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/193414/discussion-between-jerem-lachkar-and-cyclonecode). – Jerem Lachkar May 15 '19 at 17:31

1 Answers1

1

It seems to be an authentication error. You must either check SSH keys or check user and password. Use these commands if you didn’t.

git confg --global user.name “your name” git confg --global user.email “your email”

or

Make sure credentials are right. This command allows you to reenter the password.

git config --system --unset credential.helper