Sharing Host SSH Keys with Embedded Platforms: Difference between revisions

(Created page with " As embedded platforms grow larger in capabilities, it is not uncommon to perform development natively in the board itself. SSH agent forwarding allows developers to use their SSH keys across different machines without having to copy the private keys to those machines. This technique is particularly useful in scenarios involving embedded platforms, which are typically shared by multiple developers. == The Challenge with SSH Key Management == Working with services like G...")
 
Line 15: Line 15:
=== How to Start an SSH Agent ===
=== How to Start an SSH Agent ===
To start an SSH agent on your host machine, open a terminal and execute:
To start an SSH agent on your host machine, open a terminal and execute:
```bash
<syntaxhighlight lang=bash>
eval "$(ssh-agent -s)"
eval "$(ssh-agent -s)"
```
</syntaxhighlight>
To add your SSH private key to the agent, use:
To add your SSH private key to the agent, use:


```bash
<syntaxhighlight lang=bash>
ssh-add ~/.ssh/your_private_key
ssh-add ~/.ssh/id_rsa
```
</syntaxhighlight>


{{Ambox
{{Ambox
| type        = notice
| type        = notice
| text        = '''TIP!''' Start automatically your ssh agent with every session by adding the following to your shell init script (<pre style="display:inline">~/.bashrc</pre>, <pre style="display:inline">~/.zshrc</pre>, etc...)
| text        = '''TIP!''' Start automatically your ssh agent with every session by adding the following to your shell init script ('''~/.bashrc''', '''~/.zshrc''', etc...):
 
<syntaxhighlight lang=bash>
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
</syntaxhighlight>
 
}}
}}