lukesampson / pshazz

Give your powershell some pizazz.
The Unlicense
579 stars 40 forks source link

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

Closed watahani closed 5 years ago

watahani commented 6 years ago

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

What is ssh-agent ? What's wrong?

watahani commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

truckee commented 6 years ago

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

igambin commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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

thebadhatter commented 5 years ago

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

Merinorus commented 5 years ago

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 commented 5 years ago

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

dave-ops commented 5 years ago

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:

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