SSH stands for Secure Shell. This is a cryptographic network protocol that's used for operating network services securely over an unsecured network. An SSH key is a way of connecting and authenticating yourself to networks.
- SSH keys can be generated through the terminal. The code below will begin the process.
ssh-keygen -t rsa
-
The
ssh-keygen
utility prompts you to ask you where to store the key. Press ENTER to accept the default location. -
The
ssh-keygen
utility will then prompt you for a passphrase. I suggest using a passphrase as added security. You'll have to enter your passphrase twice. -
After the system generates your key pair, something like this will appear:
Your identification has been saved in /Users/myname/.ssh/id_rsa. Your public key has been saved in /Users/myname/.ssh/id_rsa.pub. The key fingerprint is: ae:89:72:0b:85:da:5a:f4:7c:1f:c2:43:fd:c6:44:38 myname@mymac.local The key's randomart image is: +--[ RSA 2048]----+ | | | . | | E . | | . . o | | o . . S . | | + + o . + | |. + o = o + | | o...o * o | |. oo.o . | +-----------------+
-
You'll now have to navigate to the folder where the keys were created. The default will be
.ssh
. This folder will be hidden in your user folder. Locate your user folder and then press⌘+⇧+.
That is the shortcut to show all hidden folders and files. -
Inside
.ssh
are your keys.id_rsa
is your private key andid_rsa.pub
is the public key and this is what we need to use. Open this file up with your favourite text editor and copy it's contents.
- Click on your icon in the top right and select
Bitbucket settings
![alt text][bitbucket_settings]
- Click
SSH keys
underSecurity
on the left
![alt text][ssh_keys]
- Give the key a label and the paste your key.
![alt text][add_key]
Awesome! You've officially setup a SSH key and got it working with Bitbucket. You can start contributing to society. This also means that you could get git-blamed
for anything you mess up ;).