Fix SSH authentication: SSH_MSG_USERAUTH_FAILURE must return auth methods list
This commit is contained in:
@@ -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" {
|
||||
// OpenSSH:none认证总是失败(用于查询支持的认证方法)
|
||||
// 返回支持的认证方法列表:password, publickey
|
||||
|
||||
Reference in New Issue
Block a user