Fix SSH authentication: SSH_MSG_USERAUTH_FAILURE must return auth methods list
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

This commit is contained in:
Warren
2026-06-15 12:03:56 +08:00
parent 03cb6913b3
commit 92669ca0e2

View File

@@ -62,7 +62,8 @@ impl AuthHandler {
} else if method == "publickey" {
// Phase 5仅实现password认证publickey留待Phase 9优化
warn!("Public key auth not implemented in Phase 5");
Ok(AuthResult::Failure("Public key auth not implemented".to_string()))
// SSH_MSG_USERAUTH_FAILURE必须返回可继续使用的认证方法列表
Ok(AuthResult::Failure("password".to_string()))
} else if method == "none" {
// OpenSSHnone认证总是失败用于查询支持的认证方法
// 返回支持的认证方法列表password, publickey