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.
This error means the key you are pushing with is attached to another repository as a deploy key, and does not have access to the repository you are trying to push to. To fix this, remove the deploy key from the repository, and add the key to your personal account instead.
The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With