add keys to agent on first connection

This commit is contained in:
theadam 2025-06-08 18:21:24 +02:00
parent e646ba3701
commit e6bda02aa5

View file

@ -25,14 +25,15 @@ After every start of WSL, add the key to the SSH agent and unlock it with the pa
`ssh-add ~/.ssh/id_ed25519`
## Forward agent
Usualy a good idea to forward the agent. With this if using a jump host, you do not need to reenter the password if connect from a host to another host. Add this or create the `~/.ssh/config` file
```
Host *
ServerAliveInterval 15
AddKeysToAgent yes
ForwardAgent yes
```
> ServerAlive useful, if the underlying connection closes the TCP sockets, E.G. Cisco EPC3925 or NATted cellular networks. This option sends dummy packet every 15 secs to keep the connection up.
- ServerAlive useful, if the underlying connection closes the TCP sockets, E.G. Cisco EPC3925 or NATted cellular networks. This option sends dummy packet every 15 secs to keep the connection up.
- `AddKeysToAgent` is an useful function that causes that you do not need to add your keys at boot with `ssh-add` command. Simply make the first connection, unlock the keys and enjoy it from the next login.
## todo
- Add the ability to ask the key password on login