First generate a key:
#ssh-keygen -t rsa
#ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /root/id_bitbucket Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/id_bitbucket. Your public key has been saved in /root/id_bitbucket.pub. The key fingerprint is: 3f:da [email protected] The key's randomart image is:
Now, add the key to the ssh-agent:
ssh-add ~/.ssh/id_bitbucket
Oops, there’s an error!
Could not open a connection to your authentication agent.
Here’s the fix:
#exec ssh-agent bash
To make sure it does not happen again, add the following to .bashrc:
SSH_AUTH_SOCK=/tmp/ssh-qoIvoV8968/agent.8968; export SSH_AUTH_SOCK; SSH_AGENT_PID=8969; export SSH_AGENT_PID;
Now, add the key to the agent.
Now, add the key to bitbucket.
after printing the public key to your screen:
#cat /root/.ssh/id_bitbucket.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCofxmd7nnaLx9aIjA5Q+U3gA2acUBvZy6NW+6kd3cqtb/QfLBVasjf/T6a7lVhNSlGYF25o+LhEJsz7A3JADXexG7VUQcuP1N4jkYlVDFx7KoLnS8tq9oaxMTwmjUMnsnJuKk+eE0y3omw3LcSf5ivAuuISd9BjlxuNHzpHHzZGZDorCEAUi2pzDerUNIbdxkaovCuERxys7ySnEChsj62auEEFN0wEKB4tW4uTLPq3XEfs3dK2RZkfjG9WTy6IoItrau9GMJPYVLVx2TFotiWCdwzbwpJHJXsQxmqdXoj3/SJgUIHNUK8oY8ykbPx9X7h/AI3xv41qwHw1A7LNePT [email protected]
Copy it entirely, including the [email protected] parameter at the end.
Now, on trying to clone a repo, it will just work.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
He is a full stack developer, whose favorite languages are currently Python and Vue.js. He is also fluent in Javascript, Flutter/Dart, Perl, PHP, SQL, C and bash shell scripting. He loves Linux, and can often be found tinkering with linux kernel code, and source code for GNU applications. He used to be an active developer on XDA forums, and his tinkered ROMS used to be very popular in the early 2000s.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.