[Bug]: IdentitiesOnly=yes incorrectly disables SSH agent authentication with a public IdentityFile
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start in pkg/remote/sshclient.go, especially createClientConfig() and createPublicKeyCallback(), which the issue identifies as the agent initialization and identity parsing entry points. Read how configured IdentityFile values and agent keys are handled, then locate the SSH client tests for regression coverage. Done means matching agent keys can authenticate with IdentitiesOnly enabled, while unrelated keys remain excluded; the issue asks for coverage with the setting both enabled and disabled.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Behavior
Wave Terminal fails to authenticate using an SSH agent when IdentitiesOnly yes is specified in ~/.ssh/config, even when IdentityFile explicitly identifies a public key whose corresponding private key is available through the agent.
The same configuration works correctly with the native OpenSSH client on Windows.
This appears to be an incompatibility with OpenSSH's documented IdentitiesOnly behavior.
Environment
OS: Windows 11
SSH agent: Bitwarden SSH Agent
SSH client comparison: Windows OpenSSH (ssh.exe)
Wave Terminal version: [insert installed version]
The private key is managed by Bitwarden and is not stored as a local file. The corresponding public key is stored locally.
Expected Behavior
Expected Behavior
According to OpenSSH's ssh_config(5) documentation:
IdentityFile may point to a public key file when the corresponding private key is managed by an SSH agent.
IdentitiesOnly yes restricts authentication to the explicitly configured identities.
It does not disable SSH agent authentication.
The SSH client should request signatures from the agent only for keys matching the configured identities.
Therefore, Wave should successfully authenticate using the matching Bitwarden-managed private key, without trying unrelated identities from the agent.
Actual Behavior
Wave appears to disable SSH agent authentication entirely when IdentitiesOnly yes is enabled, causing authentication to fail because the specified .pub file cannot be used directly as a private key.
Steps To Reproduce
Configure Bitwarden as the system SSH agent and ensure the corresponding key is available through the agent.
Add the following entry to ~/.ssh/config:
Host testserver
HostName 192.0.2.10
User root
IdentityFile C:/path/to/myhome.pub
IdentitiesOnly yes
Replace the example address and public key path with a working SSH server and the appropriate public key.
Run ssh testserver in PowerShell. Authentication succeeds.
Connect to the same host using Wave Terminal's built-in SSH connection. Authentication fails with:
ssh: handshake failed: ssh: unable to authenticate,
attempted methods [none publickey],
no supported methods remain
Comment out IdentitiesOnly yes, without changing anything else, and retry. Both Windows OpenSSH and Wave Terminal now connect successfully.
Wave Version
0.14.5
Platform
Windows 11
OS Version/Distribution
26H2
Architecture
x86_64
Anything else?
Possible Root Cause
In pkg/remote/sshclient.go, createClientConfig() contains:
if !utilfn.SafeDeref(sshKeywords.SshIdentitiesOnly) && agentPath != "" {
conn, err := dialIdentityAgent(agentPath)
// ...
}
This condition skips SSH agent initialization whenever IdentitiesOnly is true.
Additionally, createPublicKeyCallback() attempts to parse configured identity files as private keys using ssh.ParseRawPrivateKey(), without implementing the OpenSSH behavior of matching a public IdentityFile against the keys available from the agent.
Source:
https://github.com/wavetermdev/waveterm/blob/main/pkg/remote/sshclient.go
OpenSSH reference:
https://man.openbsd.org/ssh_config#IdentitiesOnly
Suggested Fix
Allow SSH agent initialization regardless of the IdentitiesOnly setting.
When IdentitiesOnly is true, filter agent-provided identities against the public keys specified by IdentityFile.
Support public-key-only IdentityFile entries, including .pub files, when the associated private key is held by the agent.
Add regression tests covering both IdentitiesOnly yes and no, with and without a matching agent key.
Workaround
Setting IdentitiesOnly no allows Wave to connect successfully.
However, this workaround changes authentication behavior by allowing additional keys from the SSH agent to be attempted. It is not equivalent to the intended OpenSSH behavior.
The issue affects SSH agents that manage private keys externally, including Bitwarden and potentially hardware-backed SSH agents.
- Ngôn ngữ chính
- Go
- Star
- 22.7k
- Fork
- 1.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wavetermdev/waveterm
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
wavetermdev/waveterm#3601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
wavetermdev/waveterm#3596 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: `wsh termscrollback` returns zero lines for valid ranges starting at line 0Có thể đã có người làm @bardrop đã nhận 6 ngày trước. Đang mởbug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
wavetermdev/waveterm#3587 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wavetermdev/waveterm#3568 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pwsh: encodeEnvVarsForPowerShell rejects Windows-standard env var names like ProgramFiles(x86), breaking wsh token on every pwsh blockCó thể đã có người làm @vortsghost2025 đã nhận 72 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
wavetermdev/waveterm#3481 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wavetermdev/waveterm
Issue tương tự
-
good first issue help wanted javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
fullsend-ai/fullsend#9733 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
karmada-io/karmada#8101 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày