Skip to content

Permissions issues with administrators_authorized_keys should have higher verbosity log output #1719

@burfo

Description

@burfo

"OpenSSH for Windows" version
7.7.2.2

Server OperatingSystem
Windows Server 2019

Client OperatingSystem
N/A

What is failing
I manually recreated the administrators_authorized_keys file which caused it to inherit permissions from its parent. This was a problem, but it wasn't obvious. A connecting client would believe that their key was rejected. On the server, the following two Operational entries show in event viewer which doesn't reveal any specific problems:

sshd: Authentication refused.
sshd: Failed publickey for USER from ...

After confirming that the key data was proper, I switched to debug output (and switched to local0/file), now I see this which still does not indicate any particular problems:

debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
Authentication refused.

After more head-scratching and eventually capturing debug3 output, I finally see this:

debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: Bad permissions. Try removing permissions for user: S-1-5-11 on file C:/ProgramData/ssh/administrators_authorized_keys.
Authentication refused.

Expected output
The bad permissions output should have a verbosity level that is much than debug3; probably not debug at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions