miyoshi-ryota / async-ssh2-tokio Goto Github PK
View Code? Open in Web Editor NEWasynchronous and easy-to-use high level ssh client library for rust
License: Apache License 2.0
asynchronous and easy-to-use high level ssh client library for rust
License: Apache License 2.0
Hi! I am wondering if I can use this library to model the ssh command: ssh -N -p 2222 -L6116:<target-host>:5432 tunnel@localhost
Authentification with ssh keys seems like an important feature.
I've found the repo there
(relevant file) that has a working implementation, as a reference.
Could you please add derives to
/async-ssh2-tokio/tree/main/src/client.rs line 100:
pub struct Client {
I would like a simple function to download a file from the remote host, e.g. using scp
.
I will probably implement this myself, it shouldn't be too difficult.
Similar Change as #65
I have a use case that requires binding a client to a specific network interface, for example something like this:
ssh -B eth1 fe80::9656:d028:8652:66b6
I believe I cannot use IP routing tables to handle this as it is specifically a link local IPv6 address. I believe tokio provides support for this (https://docs.rs/tokio/1.32.0/tokio/net/struct.TcpSocket.html#method.bind_device) but I do not believe that this library, or potentially even russh itself, support this?
Happy to make a corresponding issue over at russh as well if that makes more sense!
Currently, one has to reconnect (i.e. call Client::connect
) before every invocation of Client::execute
.
I believe it would be preferable to fix this, so that one can call execute as often as needed.
Internally I see no reason for this not to be implemented, my fix delays the call to channel_open_session
until the beginning of the execute method. See mTsBucy1@d51e5e1
A even more elegant fix would be to connect in the constructor of the client. Then the type system ensures that when there exists a Client
, it is (or at least once was) connected and authenticated. I, again, see no reason for having an unconnected Client
instance.
My fork also addressed some other ergonomic, but breaking, changes. Thus a simple PR will not suffice. I believe my changes are improvements, but I'm open to any discussion if that gets those changes merged (in a new incompatible 0.4.0 version).
Lastly, what's your status on this project, should I try to help with the development of this crate, or have you abandoned it and should I rather work on my fork?
Running git clone
on a remote windows machine with a ssh repository url fails.
I've figured out that this is somehow due to a missing tty and it can be fixed by calling Channel::request_pty(true, "vt100", 80, 24, 640, 480, &[(russh::Pty::TTY_OP_END, 0)][..])
after opening a session.
Since this is most often not wanted, this would need to be behind an option or the tty may need to be created by other methods, but I have very little knowledge in this area (is agetty
related?).
Does anyone know more?
Thanks for providing an simple abstraction over russh
!
We are often running commands that take minutes/hours to complete, and getting some feedback before the command has finished would greatly increase the user experience. If execute
(or a cousin function) could expose stdout/err like stdlib's/tokio's Command
, we could consume stdout/err and (and maybe push stdin?) while the command runs.
Will Mirror the russh_keys function signature more closely and provides greater flexibility for users.
Willing to provide a PR for it
ServerCheckMethod::DefaultKnownHostsFile or ServerCheckMethod::KnownHostsFile(...) Fail
error: "Err(Unknown server key)"
my known_hosts has the domain name listed.
async-ssh2-tokio seems to convert my domain to an IP and passes it to russh, where it will try to match it against the domain in known_hosts, and that fails
I am curious if it is possible to interact with a shell using this lib. Basically send something, then wait for the prompt, send something, wait for the prompt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.