My steps to generate and use the SSH key in Bitbucket:
ssh-keygen -t rsa -C "my email"
cat ~/.ssh/id_rsa.pub
- copy my key
ssh-rsa AAAAB3Nz... my email
to clipboard
- in bitbucket access my configuration > SSH keys
- add the key
- in console of my ubuntu, I use the command:
ssh -T git@bitbucket.org
After using the command from step 6, the following message appears:
$ ssh -T git@bitbucket.org
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?
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]
You need to use an ssh agent. try
$ ssh-add
before pushing. Supply your passphrase when asked.
If you aren't already running an ssh agent you will get the following message:
Could not open a connection to your authentication agent.
In that situation, you can start one and set your environment up thusly
eval $(ssh-agent)
Then repeat the ssh-add command.
It's worth taking a look at the ssh agent manpage.
Go through this page you would get an better idea http://jonathannicol.com/blog/2013/11/19/automated-git-deployments-from-bitbucket/