FIRST STEP CREATE SSH KEY
- List the contents of your
~/.ssh
directory.pc:~ ubuntu$ ls -a ~/.ssh known_hosts
- Create your ssh key
pc:~ ubuntu$ ssh-keygen Generating public/private rsa key pair.
Enter file in which to save the key (/Users/manthony/.ssh/id_rsa): Created directory '/Users/manthony/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/manthony/.ssh/id_rsa. Your public key has been saved in /Users/manthony/.ssh/id_rsa.pub. The key fingerprint is: 4c:80:61:2c:00:3f:9d:dc:08:41:2e:c0:cf:b9:17:69 manthony@myhost.local The key's randomart image is: +--[ RSA 2048]----+ |*o+ooo. | |.+.=o+ . | |. *.* o . | | . = E o | | o . S | | . . | | . | | | | | +-----------------+
-
List the contents of
~/.ssh
to view the key files. ls -a ~/.ssh - Open a terminal window and enter the
ps -e | grep [s]sh-agent
command to see if the agent is running:pc:~ ubuntu$ ps -e | grep [s]sh-agent 9060 ?? 0:00.28 /usr/bin/ssh-agent -l
If the agent isn’t running, start it manually with the following command:
myhost:~ manthony$ ssh-agent /bin/bash
- Load your new identity into the
ssh-agent
management program using thessh-add
command.$ ssh-add ~/.ssh/id_rsa Enter passphrase for /Users/manthony/.ssh/id_rsa: Identity added: /Users/ubuntu/.ssh/id_rsa (/Users/manthony/.ssh/id_rsa) pc:~ ubuntu$
Use the
ssh-add
command to list the keys that the agent is managing.$ ssh-add -l 2048 7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 /Users/ubuntu/.ssh/id_rsa (RSA)
Install the public key on your Bitbucket account
- Open a browser and log into Bitbucket.
- Choose avatar > Manage Account from the application menu.
The system displays the Account settings page. - Click SSH keys.
The SSH Keys page displays. It shows a list of any existing keys. Then, below that, a dialog for labeling and entering a new key. - Back in your terminal window, copy the contents of your public key file.
For example, in Linux you cancat
the contents.
cat ~/.ssh/id_rsa.pub
5. Paste the copied public key into the SSH Key field:
https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678
SECOND STEP COMMITING YOUR PROJECT