From e9ac51eee7070a4d2917a03260a83180e312726d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 22 Feb 2020 08:22:02 -0800 Subject: Add Channel::request_auth_agent_forwarding This method enables agent forwarding --- src/channel.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/channel.rs b/src/channel.rs index 82ac981..00a9493 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -204,6 +204,20 @@ impl Channel { }) } + /// Requests that the remote host start an authentication agent; + /// if successful requests to that agent will be forwarded from + /// the server back to the local authentication agent on the client side. + /// + /// Note that some hosts are configured to disallow agent forwarding, + /// and that even if enabled, there is a possibility that starting + /// the agent on the remote system can fail. + pub fn request_auth_agent_forwarding(&mut self) -> Result<(), Error> { + let locked = self.lock(); + locked + .sess + .rc(unsafe { raw::libssh2_channel_request_auth_agent(locked.raw) }) + } + /// Execute a command /// /// An execution is one of the standard process services defined by the SSH2 -- cgit v1.2.3