Skip to content

No channel handle for Agent Forwarding? #556

@aSapien

Description

@aSapien

Hi,

I'm writing an SSH jump host which should support agent forwarding. From my understanding, in order to support this functionality I need to do the following:

  1. Listen on russh::server::Handler::agent_request and call session.channel_open_agent() from the server to inform the client about an intention to use the agent.
  2. Server receives a ChannelId of the agent channel in the handler.
  3. Client server_channel_open_agent_forward handler is called, and should be ready to use the channel with an agent (receives russh::Channel<russh::client::Msg>)
  4. Server initializes an AgentClient to use in client.authenticate_publickey_with(..., ..., ..., &mut agent_client) to authenticate to the upstream.

The problem I'm facing is that in order to initialize an AgentClient on the server I need to provide an AgentStream, for which I seem to need a ChannelStream of the agent channel. However, I can't find a way to get the handle (Channel<Msg>) of the agent channel on the server. Only the ChannelId, which I can't use.

Can you provide some guidance? Perhaps I'm approaching this from the wrong angle?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions