You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Dears;
I have problem with ssh-add in wsl2 I add this in .profile or .bashrc:
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> $HOME/.ssh/ssh-agent
fi
eval `cat $HOME/.ssh/ssh-agent` > /dev/null
ssh-add $HOME/.ssh/<your ssh key> 2> /dev/null
fi
and it's worked for first time and after restart system or shutdown WSL and re run it ssh-add -l is empty and won't work and I must kill agent and re run WSL because the pid of agent changed and ssh-agent file data don't change e.g pid when run first time is 3412 and when restart WSL and run again pid is 213 but content of ssh-agent file is like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Dears;
I have problem with ssh-add in wsl2 I add this in .profile or .bashrc:
and it's worked for first time and after restart system or shutdown WSL and re run it ssh-add -l is empty and won't work and I must kill agent and re run WSL because the pid of agent changed and ssh-agent file data don't change e.g pid when run first time is 3412 and when restart WSL and run again pid is 213 but content of ssh-agent file is like this:
can someone help me for fix it
I need it because I use vscode and devcontainer
Beta Was this translation helpful? Give feedback.
All reactions