• Home
  • CentOS setup ssh key for bitbucket

CentOS setup ssh key for bitbucket

December 26, 2015 Ning 0 Comments

1. Create a new ssh key, you need enter your key name and password

$ cd ~/.ssh 
$ ssh-keygen

2. Start the ssh-agent and load your keys
replace id_ras to your key name

$ ps -e | grep [s]sh-agent
$ ssh-agent /bin/bash
$ ssh-add ~/.ssh/id_rsa
$ ssh-add -l 

3. Copy your key from ~/.ssh/yourKeyName.pub

$ cat ~/.ssh/id_rsa.pub

4. Login bitbucket avatar > Settings > SSH keys.
insert your key from step 2

5. Change your git config

$ cd ~/repos/bitbucketspacestation
$ vi .git/config

change url to ssh://git@bitbucket.org /< accountname>/.git

6. Test by

$ ssh git@bitbucket.org

leave a comment

*