Start SSH Agent on Windows/Linux


Start a local Administrator PowerShell and run the following commands:

# Make sure you're running as an Administrator
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
Get-Service ssh-agent


First, start the SSH Agent in the background by running the following in a terminal:

eval "$(ssh-agent -s)"
Then add these lines to your ~/.bash_profile so it starts on login:

if [ -z "$SSH_AUTH_SOCK" ]
   # 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" ]
        # Launch a new instance of the agent
        ssh-agent -s &> .ssh/ssh-agent
   eval `cat .ssh/ssh-agent`


Popular posts from this blog

Check MySQL query history from command line

Installing chocolatey on Windows