#maintained #rust-lang #ready-for-use

build ssh_agent_client_rs_git_bash

Add git-bash ssh-agent implementation for nresare/ssh-agent-client-rs

1 unstable release

new 0.0.11 Mar 16, 2025

#428 in Build Utils

MIT license

24KB
186 lines

ssh_agent_client_rs_git_bash

Add git-bash ssh-agent implementation for nresare/ssh-agent-client-rs
version: 0.0.11 date: 2025-03-16 author: Bestia.dev repository: GitHub

maintained ready-for-use rustlang

crates.io Documentation License Rust ssh_agent_client_rs_git_bash

Lines in Rust code Lines in Doc comments Lines in Comments Lines in examples Lines in tests

Hashtags: #maintained #ready-for-use #rustlang
My projects on GitHub are more like a tutorial than a finished product: bestia-dev tutorials.

Description

This is an extension for the crate nresare/ssh-agent-client-rs.
It adds the implementation for windows git-bash.
The original dependency is re-exported.
Instead of adding dependency to ssh-agent-client-rs, add ssh_agent_client_rs_git_bash.
Instead of Client::connect(), use the method Client::connect_to_git_bash_or_linux() of the new trait:

# Cargo.toml
[dependencies]
ssh_agent_client_rs_git_bash = {git="https://github.com/bestia-dev/ssh_agent_client_rs_git_bash.git"}
use ssh_agent_client_rs_git_bash::Client;
// import trait to scope
use ssh_agent_client_rs_git_bash::GitBash;
let mut client = Client::connect_to_git_bash_or_linux(&path_ssh_auth_sock)
    .expect("Cannot connect to ssh-agent.");
// then normal code with Client
client.list-identities().unwrap;

Windows git-bash

The implementation of ssh-agent in git-bash works over Tcp socket and is supported by this client.
The rust target is x86_64-pc-windows-gnu and can be cross-compiled from Linux to Windows.
Windows git-bash environment has also other names: cygwin, msys2, mingW64, git-for-windows, ...

Windows has other not compatible ssh-agent implementations that are NOT supported by this client.

  • Microsoft ssh works over named pipes.
  • After 2019 Microsoft introduced Unix Sockets.
  • Old and obsolete msys or msysGit

Open-source and free as a beer

My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻

//bestia.dev
//github.com/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials

Dependencies

~8–16MB
~219K SLoC