- Clone repository manually in the server. Use SSH URL to clone
- run this command
ssh-keygen
orssh-keygen -t rsa -b 4096 -C "[email protected]"
- copy
id_rsa.pub
toauthorized_keys
by doing below- cd ~/.ssh/
- cp id_rsa.pub authorized_keys
- copy settings in
~/.ssh/config
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
ServerAliveInterval 600
TCPKeepAlive yes
IPQoS=throughput
- Enable pipeline
- Add above generated SSH keys for pipeline section in repository settings
- Goto Repository Settings -> Pipelines -> SSH keys
- Copy private and public key
- Add server host in known hosts lists
- Add server IP and click on fetch. If you have other port that 22, then use SERVER_IP:PORT.
- Add public key to Profile Account Settings as well here
- Check all the files in ~/.ssh has proper file permissions. Refer
- run command
ssh -Tv [email protected]
. This will createknown_hosts
file in~/.ssh
. Dont forget to change permission ofknown_hosts
- Expected Output
authenticated via ssh key. You can use git to connect to Bitbucket. Shell access is disabled
- If not configured properly and mostly error will be
Reason for this can be - missing public key in account settings[email protected]: Permission denied (publickey).