{"id":1497,"date":"2022-01-18T23:15:58","date_gmt":"2022-01-18T23:15:58","guid":{"rendered":"https:\/\/howden.net.au\/thowden\/?p=1497"},"modified":"2022-01-18T23:49:48","modified_gmt":"2022-01-18T23:49:48","slug":"view-windows-openssh-active-settings","status":"publish","type":"post","link":"https:\/\/howden.net.au\/thowden\/2022\/01\/view-windows-openssh-active-settings\/","title":{"rendered":"View Windows OpenSSH Active Settings"},"content":{"rendered":"\n<p>I was trying to view Windows OpenSSH Active Settings, while working on the configuration of OpenSSH on Windows.<\/p>\n\n\n\n<p>I found references to using the -T parameter to see what configuration settings were active, but it was giving an error. <\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> C:\\windows\\System32\\OpenSSH\\sshd.exe -T\n'Match Group' in configuration but 'user' not in connection test specification.<\/pre>\n\n\n\n<p>Which did not make any sense, but I did some searching and found a suggestion of using another parameter with it<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> C:\\windows\\System32\\OpenSSH\\sshd.exe -T -C user=thowden<\/pre>\n\n\n\n<p>Which gave me the result I wanted with all or at least a lot of parameter settings displayed based on either the sshd_config settings or any defaults not already set. <\/p>\n\n\n\n<p>Of interest was that this function of -T not working is also addressed by the same issue that messes with the access control permissions. See <a href=\"\/windows-openssh-allow-deny-settings\/\">Windows OpenSSH Allow Deny Settings<\/a> for related info. <\/p>\n\n\n\n<p>This setting is there by default with OpenSSH on Windows. It is the cause of this grief. Comment the lines out:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">#Match Group administrators\n#       AuthorizedKeysFile __PROGRAMDATA__\/ssh\/administrators_authorized_keys<\/pre>\n\n\n\n<p>Restart OpenSSH and this command<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> C:\\windows\\System32\\OpenSSH\\sshd.exe -T<\/pre>\n\n\n\n<p>Will now work as expected without needing to add the -C etc&#8230;<\/p>\n\n\n\n<p>An update, only minutes later. It appears that the &#8216;Match&#8217; setting is the issue, and not specifically the Match Group Administrators. Adding a different Match instruction to sshd_config triggered the same error:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">PS C:\\windows\\system32> C:\\windows\\System32\\OpenSSH\\sshd.exe -T\n'Match User' in configuration but 'user' not in connection test specification.<\/pre>\n\n\n\n<p>The Win32-OpenSSH at GitHub is the source of many questions and some answers with sorting out an installation of OpenSSH on Windows. <\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/PowerShell\/Win32-OpenSSH\">https:\/\/github.com\/PowerShell\/Win32-OpenSSH<\/a><\/p>\n\n\n\n<p>Note that the version installed for Windows Server 2019 is version 7.7p1 while Windows 10 users will get a later version. Much later at version 8.x. For the server users, you will need to wait for Windows Server 2022 to get an updated version. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to view Windows OpenSSH Active Settings, while working on the configuration of OpenSSH on Windows. I found references to using the -T parameter to see what configuration settings were active, but it was giving an error. Which did not make any sense, but I did some searching and found a suggestion of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,126,22],"tags":[],"class_list":["post-1497","post","type-post","status-publish","format-standard","hentry","category-openssh","category-security-2","category-windows-servers"],"_links":{"self":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/comments?post=1497"}],"version-history":[{"count":5,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1497\/revisions"}],"predecessor-version":[{"id":1502,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/posts\/1497\/revisions\/1502"}],"wp:attachment":[{"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/media?parent=1497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/categories?post=1497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howden.net.au\/thowden\/wp-json\/wp\/v2\/tags?post=1497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}