Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set Personal SSH Key on Linux (and Mac) guide error

Gabi Davar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2023

 

Hi,

https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-linux/

creates an SSH key using  `-f` under user's home directory:

ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}

but the ssh configuration snippet assumes the key was generated under ./ssh :

Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/{ssh-key-name}

Unless I'm missing some magic behind the scenes the guide only works since the key was added to the ssh-agent.

It would seem correct and more secure to modify the guide to generate the key under ~/.ssh (instead of ~).

Thanks!

 

Hi Peter,

Thank you for your quick answer.

I don't see anything in the above man page which suggests ssh-add copies keys to ~/.ssh. It only states that if no files are given the certain default are used.

It is easily shown when tested:


$ ssh-keygen -t ed25519 -b 4096 -C "XXXXXXXXXXXXX" -f test-key
Generating public/private ed25519 key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in test-key
Your public key has been saved in test-key.pub
The key fingerprint is:
SHA256:9hRqgtxVpnZvjXd4GAJPtFqvDhd16PyoVphQd77skko XXXXXXXX.com
The key's randomart image is:
+--[ED25519 256]--+
| +.o |
| + +.....|
| + o.=.+o.|
| . o o o.= O =.|
| o o S o.=oX +|
| + o .o+.B |
| oEo.+ .|
| .+.+ . |
| o+ . |
+----[SHA256]-----+
$ ls test-key*
test-key test-key.pub
$ ls ~/.ssh/test-key*
ls: cannot access '/home/XXXXX/.ssh/test-key*': No such file or directory
$ ssh-add test-key
Identity added: test-key (XXXXXX.com)
$ ls ~/.ssh/test-key*
ls: cannot access '/home/XXXXX/.ssh/test-key*': No such file or directory

 

1 answer

0 votes
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2023

Hi @Gabi Davar ,

First off: welcome to the Atlassian Community.

If I read the guide correctly this command:

ssh-add ~/{ssh-key-name}

Actually creates the different files under ~/.ssh/

As explained here: https://linux.die.net/man/1/ssh-add

And that's why that command works as far as I know.

If you feel there is still an error I would suggest using the "Provide Feedback about this article" link at the bottom of the article. That should send your feedback directly to the right team.

I hope that helps.

Cheers,
Peter

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events