diff --git a/markbase-core/src/ssh_server/channel.rs b/markbase-core/src/ssh_server/channel.rs
index 9c09e95..05b4fa2 100644
--- a/markbase-core/src/ssh_server/channel.rs
+++ b/markbase-core/src/ssh_server/channel.rs
@@ -183,6 +183,7 @@ impl ChannelManager {
scp_output_file: None, // Phase 17: SCP file receive
direct_tcpip: None,
forwarded_tcpip: None,
+ auth_agent_socket: None,
};
self.channels.insert(server_channel, channel);
@@ -263,6 +264,7 @@ impl ChannelManager {
scp_output_file: None, // Phase 17: SCP file receive
direct_tcpip: Some(direct_tcpip),
forwarded_tcpip: None,
+ auth_agent_socket: None,
};
self.channels.insert(server_channel, channel);
@@ -340,6 +342,7 @@ impl ChannelManager {
scp_output_file: None, // Phase 17: SCP file receive
direct_tcpip: None,
forwarded_tcpip: Some(forwarded_tcpip),
+ auth_agent_socket: None,
};
self.channels.insert(server_channel, channel);
@@ -409,6 +412,8 @@ impl ChannelManager {
self.handle_env_request(&mut cursor, recipient_channel, want_reply) // 移除?操作符
} else if request_type == "pty-req" {
self.handle_pty_request(&mut cursor, recipient_channel, want_reply) // 移除?操作符
+ } else if request_type == "auth-agent-req@openssh.com" {
+ self.handle_auth_agent_request(recipient_channel, want_reply)
} else {
warn!("Unsupported channel request: {}", request_type);
if want_reply {
@@ -702,6 +707,41 @@ impl ChannelManager {
}
}
+ /// SSH Agent forwarding(参考OpenSSH auth-agent.c)
+ /// 支持 "auth-agent-req@openssh.com" channel request
+ fn handle_auth_agent_request(
+ &mut self,
+ channel: u32,
+ want_reply: bool,
+ ) -> Result