andy@pop-os ~/.ssh> cut --characters -40 id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJ
When I try this pub key bitbucket says "Someone has already added that key as an access key to a repository"
I have a personal and corporate Bitbucket account. Why Bitbucket requires separate SSH for them? I use the same laptop.
I checked all of them but my personal accounts did not have an SSH associated with them. Should I create two SSH for personal and corporate? How to use them at the same time?
andy@pop-os ~> ls .ssh/
id_rsa id_rsa_corporate id_rsa_corporate.pub id_rsa.pub known_hosts
andy@pop-os ~> uname --nodename
pop-os
I have configured bitbucket to use my corporate key manually. Is there a Linux command to do it automatically?
andy@pop-os ~> cd /etc/ssh/
andy@pop-os /e/ssh> head ssh_config -50
head: invalid trailing option -- 5
Try 'head --help' for more information.
andy@pop-os /e/ssh [1]> head -30 ssh_config
Include /etc/ssh/ssh_config.d/*.conf
Host bitbucket-corporate
HostName bitbucket.org
IdentityFile ~/.ssh/id_rsa_corporate
Host *
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
It works for corporate:
andy@pop-os ~> ssh -vT git@bitbucket.org
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for bitbucket.org
debug1: /etc/ssh/ssh_config line 26: Applying options for *
debug1: Connecting to bitbucket.org [104.192.141.1] port 22.
debug1: Connection established.
debug1: identity file /home/andy/.ssh/id_rsa_cogniflare type 0
debug1: identity file /home/andy/.ssh/id_rsa_cogniflare-cert type -1
...
But how do I manage SSH keys and change my personal Bitbucket account to use my personal `id_rsa` SSH private key on the same computer?
Is there an easy way other than modifying `/etc/ssh/ssh_config`?