Recommendations for designing an SSH client

I would like to add an SSH client to my TUI. It will be used to ssh to a remote server and run interactive applications (bash, vi, tmux, etc). Basically an SSH terminal inside a TUI. I found that Wezterm is quite powerful so I was thinking of making a widget that utilizes the wezterm-ssh crate for the ssh/terminal stuff. Do I need to use the termwiz backend in this case?

I’m not sure how to start and am actually just looking for high-level design suggestions. What components will I need, etc?

1 Like

Hello,

I would suggest you use a Russh+Ratatui stack. There are some good examples out there, from simple ones GitHub - joshka/pong-russh to very complex ones GitHub - Patryk27/kartoffels: a game where you're given a potato and your job is to implement a firmware for it.

I would first start with something very simple and then try to add functionalities as you go, for which maybe I can give more precise suggestions.

1 Like

One thing to look at is how long since a crate has had a release. Wezterm-ssh is about 3 years old, so I’d be cautious of using it.

I definitely agree that russh is the right way to go. The examples provided are servers more than clients. The approach / types used will be similar though, and perhaps simpler? I’d add that the tui-term crate might be worth looking at too.

One thing to note about doing an SSH client is that to be secure you have to get 100% of the security things right (and there’s likely a bunch that you haven’t considered unless you’re in that space already).

2 Likes