User Tools

Site Tools


windows:wsl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
windows:wsl [2019-08-11 01:01] – ssh-agent hack gabrielwindows:wsl [2019-08-18 22:20] (current) – [Using ssh-agent with multiple shell sessions] link to GitLab gabriel
Line 23: Line 23:
  
 ===== Using ssh-agent with multiple shell sessions ===== ===== Using ssh-agent with multiple shell sessions =====
 +
 +//These scripts are now maintained [[https://gitlab.com/unxis/unxtools/tree/master/wsl/ssh-agent|here in GitLab]].//
  
 WSL doesn't run a full Linux system, rather it acts as an translation layer that can emulate the software WSL doesn't run a full Linux system, rather it acts as an translation layer that can emulate the software
Line 34: Line 36:
  
 <code> <code>
-# start ssh-agent +# start ssh-agent for WSL 
-SSHAGENTINFO=/tmp/${USER}-ssh-agent/info+SSHAGENTINFO=/tmp/${USER}-ssh-agent/conf
 if [ -f $SSHAGENTINFO ]; then if [ -f $SSHAGENTINFO ]; then
   printf "Reading ssh-agent socket info from %s.\n" $SSHAGENTINFO   printf "Reading ssh-agent socket info from %s.\n" $SSHAGENTINFO
Line 48: Line 50:
  
 <code> <code>
-# shut down our ssh-agent when we close the shell +# shut down our ssh-agent when we close the final shell 
-ssh-agent -k && rm -f /tmp/${USER}-ssh-agent/info+SHELLPIDS=$( pgrep bash ) 
 +SHELLCOUNT=$( echo $SHELLPIDS | wc -w ) 
 +if [[ $SHELLCOUNT -eq 1 ]]; then 
 +  ssh-agent -k && rm -f /tmp/${USER}-ssh-agent/conf 
 +fi
 </code> </code>
windows/wsl.txt · Last modified: 2019-08-18 22:20 by gabriel