Implement AgentClient::connect_uds on Windows
I tried to run basic examples but hit a problem with
let mut agent = russh_keys::agent::client::AgentClient::connect_env().await.unwrap();
where connect_env returns only error on non-unix platform. Does this library supposed to work under platform otherthan linux?
russh-keys AgentClient class only supports SSH agent connections via UNIX sockets, so it doesn't work on Windows. The rest of russh works on Windows.
(if you're learning russh through examples, it's a better idea to start with remote_shell_call which is newer as opposed to client.rs which was inherited from thrussh)
so it doesn't work on Windows.
FWIW, UNIX domain sockets have worked on windows for several years now, there's no reason not to support it here
Yup but IIRC openssh agent uses a named pipe on windows instead
From: Wez Furlong @.> Sent: Friday, September 8, 2023 3:34:43 PM To: warp-tech/russh @.> Cc: Eugene @.>; State change @.> Subject: Re: [warp-tech/russh] Does this library work on Windows? (Issue #177)
so it doesn't work on Windows.
FWIW, UNIX domain sockets have worked on windows for several years nowhttps://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/, there's no reason not to support it here
— Reply to this email directly, view it on GitHubhttps://github.com/warp-tech/russh/issues/177#issuecomment-1711683254, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABHNRGKIGFMAIJ64BL2KLDXZMNHHANCNFSM6AAAAAA4PULI3M. You are receiving this because you modified the open/close state.Message ID: @.***>
There are other ssh agents that run on windows that use unix domain sockets
I was able to get this working on Windows with this small change to russh-keys:
#[cfg(windows)]
impl AgentClient<tokio::net::windows::named_pipe::NamedPipeClient> {
pub async fn connect_windows() -> Result<Self, Error> {
let stream = tokio::net::windows::named_pipe::ClientOptions::new()
.open(r"\\.\pipe\openssh-ssh-agent")?;
Ok(AgentClient {
stream,
buf: CryptoVec::new(),
})
}
}
Then agent.request_identities() returns a non-empty list.
Except it seems to not be returning my ECDSA keys:
[2023-09-22T19:01:19Z INFO russh_keys::agent::client] Unsupported key type: Ok("ecdsa-sha2-nistp256")
@eminence russh doesn't have support for ECDSA keys yet - only RSA and Ed25519