Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to start ssh-agent service, error :1058 #70

Closed
watahani opened this issue May 29, 2018 · 14 comments
Closed

unable to start ssh-agent service, error :1058 #70

watahani opened this issue May 29, 2018 · 14 comments

Comments

@watahani
Copy link

watahani commented May 29, 2018

After install KB4103721, the error was shown unable to start ssh-agent service, error :1058.

What is ssh-agent ? What's wrong?

@watahani
Copy link
Author

watahani commented May 29, 2018

It seems the issue is caused by $profile file encoding. Changing file encoding from UTF16-LE to
Shift-JIS and error is not shown. (My System language is Japanese)
But it has never been happened since I start to use phazz.

@colin-kirkham
Copy link

I'm hitting exactly the same problem and even a full reinstall of scoop doesn't fix the issue. Any tips on how to get past the warning?

@StormPooper
Copy link

StormPooper commented Jun 6, 2018

Having the same problem, even if I run ssh-agent manually. I've removed Windows 10 1803's OpenSSH agent (Optional Features on the Start Menu) as a workaround, but it would be nice if this worked without having to do that. Posh-git is having similar issues - see dahlbyk/posh-git#583.

@myty
Copy link
Contributor

myty commented Jun 6, 2018

I was getting this message and I went into look at the local services and the actual "OpenSSH Authentication Agent" service was disabled. Maybe the 1803 update disabled it, but I'm not sure. I set the service to automatic and now all is fine.

@Neusbeer
Copy link

C:\environment>ssh-agent
unable to start ssh-agent service, error :1058

WIth PowerShell I ran install-sshd.ps1

cd .\Program Files\OpenSSH-Win64
PS C:\Program Files\OpenSSH-Win64> .\install-sshd.ps1
[SC] SetServiceObjectSecurity SUCCESS
[SC] ChangeServiceConfig SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
sshd and ssh-agent services successfully installed

that worked for me

@Ash258
Copy link

Ash258 commented Oct 4, 2018

I fixed it by Set-Service ssh-agent -StartupType Manual With windows 10 built in SSH

@truckee
Copy link

truckee commented Oct 5, 2018

This error occurred after 1809 update. Opening PowerShell as Admin & running Set-Service ssh-agent -StartupType Manual fixed this issue for me.

@igambin
Copy link

igambin commented Oct 11, 2018

C:\environment>ssh-agent
unable to start ssh-agent service, error :1058

WIth PowerShell I ran install-sshd.ps1

cd .\Program Files\OpenSSH-Win64
PS C:\Program Files\OpenSSH-Win64> .\install-sshd.ps1
[SC] SetServiceObjectSecurity SUCCESS
[SC] ChangeServiceConfig SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
sshd and ssh-agent services successfully installed

that worked for me

that is what worked for me too. I think that is the best solution anyway as it will allow you to properly run the service instead of just disabling it.

One gotcha: openssh was not even installed on my machine so I just installed it using chocolatey

choco install openssh

and then after "refreshenv" I applied neusbeers fix. worked like a charm. THX!

@mongoishere
Copy link

C:\environment>ssh-agent
unable to start ssh-agent service, error :1058

WIth PowerShell I ran install-sshd.ps1

cd .\Program Files\OpenSSH-Win64
PS C:\Program Files\OpenSSH-Win64> .\install-sshd.ps1
[SC] SetServiceObjectSecurity SUCCESS
[SC] ChangeServiceConfig SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
sshd and ssh-agent services successfully installed

that worked for me

This also worked for me, much appreciated.

@chawyehsu chawyehsu pinned this issue Jan 12, 2019
@chawyehsu
Copy link
Collaborator

With #76 , the ssh plugin can now detect and start the service automatically.

@thebadhatter
Copy link

Set-Service ssh-agent -StartupType Manual
Worked for me also.

@Merinorus
Copy link

I confirm, I was having the same issue and set the startup type as manual. I found it on thie blog but that's exactly the recommandation of most of you.

@TwoAD7
Copy link

TwoAD7 commented Apr 16, 2019

Set-Service ssh-agent -StartupType Manual
This worked for me,thanks!

@dave-ops
Copy link

dave-ops commented May 19, 2019

assuming you already created the authorized_users file in the users .ssh folder on the server and have these set in your sshd_config file

PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile	.ssh/authorized_keys
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#Match Group administrators
#       AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

then do this to finish up, while on the server:

  • Go to the Type Here to Search Box and type Services

  • go to Services

  • double click OpenSSH Authentication Agent

  • set the startup type to Automatic

  • click Start

  • Click Ok and Exit

  • still in the server open Windows Explorer go to your c:/users//.ssh directory

  • right click on authorized_users and click properties

  • go to security > advanced

  • click disable inheritence and convert permissions

  • remove all users except system and yourself

  • click ok and exit out

  • now go back to services and restart the OpenSSH Authentication Agent

you should now be able to ssh into the server using your public key

Repository owner locked as resolved and limited conversation to collaborators May 22, 2019
@chawyehsu chawyehsu unpinned this issue May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests