Fix SSH authentication: SSH_MSG_USERAUTH_FAILURE must return auth methods list
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
+2 -1
View File
@@ -62,7 +62,8 @@ impl AuthHandler {
} else if method == "publickey" { } else if method == "publickey" {
// Phase 5仅实现password认证,publickey留待Phase 9优化 // Phase 5仅实现password认证,publickey留待Phase 9优化
warn!("Public key auth not implemented in Phase 5"); 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" { } else if method == "none" {
// OpenSSH:none认证总是失败(用于查询支持的认证方法) // OpenSSH:none认证总是失败(用于查询支持的认证方法)
// 返回支持的认证方法列表:password, publickey // 返回支持的认证方法列表:password, publickey