Incorrect command in BitBucket SSH setup for MacOS?
Asked by Bitwise DEVS:

Hi, I recently followed <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/>  

Unfortunately the command for checking running SSH agent is not working giving me.

```
No user named 'xc'
```

But after trying the below command it seems I got what the documentation wanted me to do.

```
ps aux | grep ssh-agent
```

This gives me something similar response from the expected output.

```
username  40101   0.0  0.0 408635088   1392 s000  S+    3:51PM   0:00.00 grep ssh-agent
```

Also why do we need to add config file under .ssh folder if we already executed ssh-add command? If I understand correctly both steps just do the same thing. The step for ssh config is also incorrect and will not work based on the previous step, since the creation of private and public key is in the home directory while the suggested ssh config is IdentityFile is pointing inside .ssh folder.


Answers:
author: Joakim B_
body: For anyone who ended up here like me because of the error **No user named 'xc'** when typing **ps -auxc \| grep ssh-agent** in Terminal, the command OP wrote is slightly wrong.

++**The correct command is:**++

```
ps auxc | grep ssh-agent
```

comments: author: Bitwise DEVS
body: Nope, this is not working on my end and prints nothing on my terminal. I tried different approach but only the above command is what working on me.


author: Theodora Boudale
body: Hi [@Bitwise DEVS](/t5/user/viewprofilepage/user-id/3162676),

Thank you for your feedback. I will reach out to the team that maintains the documentation both for the command **ps -auxc \| grep ssh-agent** and also for the paths in the **\~/.ssh/config** file. By default, the SSH key pair is generated in the **\~/.ssh** directory.
> Also why do we need to add config file under .ssh folder if we already executed ssh-add command?

If you restart your computer and the key is not added to the agent after the restart, or if you have multiple SSH keys added to your agent, then the correct one may not be offered when you try to clone, pull, or push to a Bitbucket Cloud repo. The config ensures that the key you have added to your Bitbucket Cloud account will be used every time you clone, pull, or push to a Bitbucket Cloud repo via SSH.

Please feel free to reach out if you have any other questions!

Kind regards,  
Theodora

comments: author: Bitwise DEVS
body: Thanks for answering, however based on the instruction from the documentation the generated SSH key pair will actually be in the root of home directory by default and there is no .ssh directory from a fresh setup on MacOS Ventura.


author: Theodora Boudale
body: You are right, the SSH key pair is generated in the \~/.ssh directory by default when the -f argument is not used. Apologies for the confusion caused by this. I will pass this on to the documentation team as well.

Regards,  
Theodora


author: Navin ES
body: The first part of OPs comment re: the incorrect command to check if the SSH agent is running, is still not fixed. Ref: <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/>


author: jeevansonm
body: I ended up here due to the mistake in the official documentation. Please correct it as early as possible.

Correct command,  

```
ps aux | grep ssh-agent
```


Tags: atlassian-support

cloud