SSH agent service in Windows

Here is a description how to set up your SSH agent in Windows using Services. 

ssh

Start up a PowerShell terminal and copy your private ssh key to your C:\Users\<username>/.ssh folder. For example, if you have it on your home drive:

PS C:> scp username@pingo.uio.no:~/.ssh/id_rsa C:\Users\username\.ssh\ 

 

If you do not have a ssh key, you can create one:

PS C:\> ssh-keygen

We strongly recommend you set a passphrase.

The Windows Service

Start a PowerShell session as administrator. 

PowerShell as admin

Check if the SSH Agent is running using the Get-Service command:

Get-Service ssh-agent 

Status Name       DisplayName 
------ ----       ----------- 
Stopped ssh-agent OpenSSH Authentication Agent

Configure the SSH agent to start each time the device is started, use the Set-Service command, such as:

Set-Service -Name sshd -StartupType 'Automatic'

 

To start the agent:

Start-Service ssh-agent

Now you can add the agent:

PS C:\> ssh-add  

 

Tags: ssh, Windows, Services By Kjetil Bakke
Published Sep. 7, 2023 11:22 AM - Last modified Sep. 7, 2023 11:22 AM