+ SSH agent
+ Kubectl changes in review description
This commit is contained in:
parent
a77d65270a
commit
14925b27c1
3 changed files with 59 additions and 0 deletions
29
ssh-agent-in-wsl.md
Executable file
29
ssh-agent-in-wsl.md
Executable file
|
@ -0,0 +1,29 @@
|
|||
# SSH agent in WSL
|
||||
|
||||
There are a plenty of ways to enable the SSH agent in WSL to avoid the password ask at every connect to a remote host.
|
||||
|
||||
One of them is the following.
|
||||
|
||||
Add these lines to the ~/.profile file
|
||||
```
|
||||
ssh_pid=$(pidof ssh-agent)
|
||||
|
||||
# If the agent is not running, start it, and save the environment to a file
|
||||
if [ "$ssh_pid" = "" ]; then
|
||||
ssh_env="$(ssh-agent -s)"
|
||||
echo "$ssh_env" | head -n 2 | tee ~/.ssh_agent_env > /dev/null
|
||||
init=1
|
||||
fi
|
||||
|
||||
# Load the environment from the file
|
||||
if [ -f ~/.ssh_agent_env ]; then
|
||||
eval "$(cat ~/.ssh_agent_env)"
|
||||
fi
|
||||
```
|
||||
|
||||
After every start of WSL, add the key to the SSH agent and unlock it with the password. For example when starting the day, after WSL start
|
||||
`ssh-add ~/.ssh/id_ed25519`
|
||||
|
||||
## todo
|
||||
- Add the ability to ask the key password on login
|
||||
- Store the SSH key between restarts (probably requires external packages)
|
Loading…
Add table
Add a link
Reference in a new issue