Scripts to use to persist ssh-agent
on WSL + Ubuntu
- Open Windows bash (WSL)
- Put the scripts into place
mkdir -p ~/local/bin
cp -vf ./start-ssh-agent ~/local/bin
- Open Task Scheduler and create a scheduled task (optionally in a directory
MyTasks
) to execute this command at login
powershell -NoProfile -WindowStyle Hidden -Command C:\Windows\System32\bash.exe -c "~/local/bin/start-ssh-agent"
- After the task is created, open the task properties and under conditions, uncheck power options.
- Finally, open Bash, and edit your
.bashrc
to include the following:
# Make shell aware of SSH_AGENT_PID and SSH_AUTH_SOCK variables
# so that processes can communicate with ssh-agent
. ~/.ssh/environment > /dev/null
MIT License