Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the SSH key for Bitbucket projects?

Tags:

git

ssh

bitbucket

My steps to generate and use the SSH key in Bitbucket:

  1. ssh-keygen -t rsa -C "my email"
  2. cat ~/.ssh/id_rsa.pub
  3. copy my key ssh-rsa AAAAB3Nz... my email to clipboard
  4. in bitbucket access my configuration > SSH keys
  5. add the key
  6. in console of my ubuntu, I use the command: ssh -T [email protected]

After using the command from step 6, the following message appears:

$ ssh -T [email protected]
logged in as ricardoramos.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

When I make a push to my repository, still continues requiring my password.

It is very annoying to have to keep typing the password for every push.

Where am I wrong?

like image 415
ricardoramos Avatar asked Oct 21 '25 08:10

ricardoramos


1 Answers

You can't login to bitbucket's shell using SSH, but you did set up your key correctly, otherwise you wouldn't have gotten the "Shell access is disabled" message.

What you have to do is change the URL of your repo. Right now you have a HTTPS URL set, which requires a password. You can switch to an SSH URL like this:

git remote set-url origin [ssh url of your git repo]
like image 64
jornane Avatar answered Oct 22 '25 23:10

jornane



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!