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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

Edited

 

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.
Mar 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