a.toraby
a.toraby

Reputation: 3391

Permission denied when I try to push from local to remote gitlab repository

I have created a repository in gitlab web ui and tried to push my local repository. I added remote repo using the following command:

$ git remote add origin [email protected]:project.git

Then I tried to push but it errors. I don't use ssl. I want to use plain text connection.

$ git push origin master
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied (publickey,password).
fatal: Could not read from remote repository.

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

Upvotes: 5

Views: 16910

Answers (3)

Sibeesh Venu
Sibeesh Venu

Reputation: 21779

One of my colleagues was facing the same issue. For him, it was the issue with setting the SSH. It seems like the credential used was incorrect. And just cleaning that resolved that issue.

$ git config --system --unset credential.helper
$ git config --global --unset credential.helper

Thanks to Patthoyts for this answer.

Upvotes: 0

Rick Stevens
Rick Stevens

Reputation: 21

Newer versions of ssh also disallow DSA key use by default. Make sure you're using RSA keys or make sure your ~/.ssh/config or /etc/ssh/ssh_config files permit DSA keys. You can do this by adding something like this to the appropriate file:

Host your.git.server
    KexAlgorithms +diffie-hellman-group1-sha1
    HostkeyAlgorithms ssh-dss,ssh-rsa

This one bit me.

Upvotes: 2

VonC
VonC

Reputation: 1326706

Then I created the test user from web ui. and created the project with the test user.

You would never use that user for contacting a server in ssh: all the authorized keys are grouped under one account, which for gitlab should be git: ~git/.ssh/authorized_keys

See config/gitlab.yml.

So try:

git remote set-url origin [email protected]:project.git

Upvotes: 9

Related Questions