0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows 11 に SSH サーバーを立てて公開鍵認証

Posted at

AuthorizedKeysFileの設定の仕方がUbuntuサーバーへのSSH接続と異なっており、少々手間取ったのでここに備忘録として残しておく。

公式のページがやはり役に立った。
[参照資料]https://learn.microsoft.com/ja-jp/windows-server/administration/OpenSSH/openssh-server-configuration

以下全文引用

AuthorizedKeysFile
The default is .ssh/authorized_keys. If the path isn't absolute, 
it's taken relative to user's home directory (or profile image path), for
example, C:\Users\username. If the user belongs to the administrator group,
%programdata%/ssh/administrators_authorized_keys is used instead.

 ヒント
The administrators_authorized_keys file must only have permission entries
for the NT Authority\SYSTEM account and BUILTIN\Administrators security
group. The NT Authority\SYSTEM account must be granted full control. The
BUILTIN\Administrators security group is required for administrators to 
manage the authorized keys, you can choose the required access. To grant
permissions you can open an elevated PowerShell prompt, and running the
command icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys"
/inheritance:r /grant "Administrators:F" /grant "SYSTEM:F".

どうやら、ユーザーが管理者グループであれば%programdata%/ssh/administrators_authorized_keysが優先して、参照されるようだった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?