5

I'm using Windows 10 OpenSSH version. After update to Windows 1809 I've got

C:\Windows\System32\OpenSSH\ssh.exe myhost
Bad owner or permissions on C:\\Users\\XXX/.ssh/config

But execution

c:\Windows.old\Windows\System32\OpenSSH\ssh.exe myhost

is successful.

Versions are slightly different

C:\Windows.old\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.5
C:\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

I've tried to 'cleanup' permissions like described but it doesn't help.

2
  • I have everything in place and owner and file permissions are the same. I find out a kind of workaround: uninstall OpenSSH build and using ssh build included in latest git-for-windows installation Commented Oct 5, 2018 at 19:50
  • Take a look at Cygwin sshd vs Microsoft sshd on the Cygwin mailing list; and sshd issues on Windows 10 version 1803 on the Sourceware mailing list. It looks like the fix is in the works, but the author says it may take a couple of weeks.
    – jww
    Commented Oct 5, 2018 at 20:41

2 Answers 2

3

I had a similar issue and fixed it by changing file's DACL (permissions) by removing inheritance and leaving only the user, SYSTEM and Administrators to have Full control access:

icacls C:\Users\xxx\.ssh\config
C:\Users\xxx\.ssh\config NT AUTHORITY\SYSTEM:(I)(F)
                            BUILTIN\Administrators:(I)(F)
                            DOMAIN\xxx:(I)(F)

I used explorer's GUI for that, but it can be done by icacls as well. Example:

> icacls.exe .\.ssh\config /grant everyone:f 
> ssh 127.0.0.1
Bad owner or permissions on C:\\Users\\xxx/.ssh/config
> icacls.exe .\.ssh\config /inheritance:d
> icacls.exe .\.ssh\config /remove everyone
> ssh 127.0.0.1
ssh 127.0.0.1
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
[email protected]'s password:
0

I had similar problem, after the upgrade to 1809 Windows installed it's own ssh.exe. Ssh delivered with Cygwin works just fine:

There are following ssh.exe installed:

C:\Users\ebajgrz\.ssh>where ssh
C:\Windows\System32\OpenSSH\ssh.exe
c:\cygwin64\bin\ssh.exe

The ssh client from Windows complains about permissions:

C:\Users\ebajgrz\.ssh>C:\Windows\System32\OpenSSH\ssh.exe myserver
Bad owner or permissions on C:\\Users\\ebajgrz/.ssh/config

Cygwin's ssh works just fine:

C:\Users\ebajgrz\.ssh>C:\cygwin64\bin\ssh.exe myserver
Last login: Wed Feb 19 09:01:35 2020 from 100.93.177.156
[ebajgrz@myserver ~]$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .