James
James

Reputation: 2860

Git always asking for username and password even with using SSH key

I have started an online Gitlab account to host some of my projects.

I have set up my account, generated my SSH key and entered this into the SSH Keys section of the Gitlab site. Whenever I attempt to git push, git pull or whatever I still get prompted for my username and password. I have followed the instructions on the Gitlab website to make sure I am not forgetting any steps and it still prompts me.

My key looks like this:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNoni9GhAESKyneV76Xp/bEc8Pb/eN4MxBrP6kfam9CjPADxrmtVeUFjnZuo+kgSRxAHvMiu6MqbINMQtCt9fNOrX0uCW0e5AoQwC9w1jz+JaReqWyw87A5Tk/4AOM6TZ1oY0R/uGgiFQaxkK1YWOxRrPcC+Lan/RawFflVeYYFzGOf8jcj+VhUk2TPewcZ6dPH3XL1op+Aau35VCs/FcaCPH/MKsrqMgx4blsvzjNLKUOkOYWyQP2wVsLdyKH4vUE9ISsZZWTgQoOfqEqD/VdugOUrxw9EorN7bFMHF4dY5AHTPIgWobo7Qw6ZJczIEF6Wgdrcc1L1JZoXeGvgIFL [email protected]

Is there any other things that may be causing this?

I am using Linux and terminal to generate these commands Thanks

Upvotes: 0

Views: 1874

Answers (1)

CodeWizard
CodeWizard

Reputation: 141976

You are using http/https as your remote url.
Change it to ssh and it will not ask you for username password again.

Check your remote url, you might be using https

git remote -v

Http/https will ask yo for password every time you try to fetch | pull| push etc.

SSH is not using username/password nut use the ssh keys instead.

Using ssh your connection is secured using the ssh keys exchange.

enter image description here

Upvotes: 4

Related Questions