`OWNER RIGHTS` not allowed on identity file ACL, even if owner is in `Administrators`

Đang mở
#2,317 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

@tgauth đang làm issue này rồi.

Từ ngày 6/1/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Investigate
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

When a private key identity file has the OWNER RIGHTS group permission attached and the file is owned by an administrator, the OpenSSH client fails with a warning that the file's permissions are too open:

> ssh -p port -i C:\Path\To\TempDir\Keyfile destination

Bad permissions. Try removing permissions for user: \\OWNER RIGHTS (S-1-3-4) on file C:\Path\To\TempDir\Keyfile.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\Path\To\TempDir\Keyfile' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\Path\To\TempDir\Keyfile": bad permissions
destination: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

My understanding is that only administrators and System can have access to the key file. It looks like the client explicitly checks for the admin and system SIDs, but does not follow an owner rights SID and checks that the file is owned by an admin. I was curious if maintainers would be open to allowing OWNER RIGHTS provided that the owner is an admin.

Related:

Expected behavior
# Identity file with `OWNER RIGHTS` permissions attached
> ssh -p port -i C:\Path\To\TempDir\Keyfile destination

# SSH succeeds
Last login: Tue Dec 17 20:44:37 2024 from foo
Actual behavior
# Identity file with `OWNER RIGHTS` permissions attached
> ssh -p port -i C:\Path\To\TempDir\Keyfile destination

# SSH fails
Bad permissions. Try removing permissions for user: \\OWNER RIGHTS (S-1-3-4) on file C:\Path\To\TempDir\Keyfile.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\Path\To\TempDir\Keyfile' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\Path\To\TempDir\Keyfile": bad permissions
destination: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Error details

No response

Environment data
Name                           Value
----                           -----
PSVersion                      5.1.20348.2760
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2760
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Version

9.5

Visuals

image

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
8.4k
Fork
824
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/Win32-OpenSSH

Tất cả issue của PowerShell/Win32-OpenSSH

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.