views:

57

answers:

2

I'm messing around with Tamir.SharpSsh and wanted to see if it was possible to use it to implement a console SSH client fully in C#. I do not mean something like putty where it's actually running in it's own GUI, but something you could run directly from the windows cmd console.

The library is pretty great, except that it doesn't handle terminal emulation in any way. So when using SshShell, you can do some basic interaction, but the output is often very ugly and full of random characters and you cannot actually interact with things like shell scripts, etc.

As far as I can tell SharpSSH simply redirects the IO to the console IO.

How hard would it be to redirect this elsewhere and handle the terminal emulation? Also, is there an emulation library (C# and open source, preferably) already that I could use?

Edit: Gave up on SharpSSH, see answer below for the final solution I came up with.

+1  A: 

I'm looking for the same thing. There is a library here that costs $700. Found another one on codeproject that looks shoddy but might be a good start. And there is an incomplete implementation right here on stackoverflow. Still searching..

Luke
A: 

I have actually since abandoned trying to use SharpSSH. It is a good library, but was just too lacking in overall functionality. I am now using a library called Granados which is a much more fleshed out SSH implementation. It has a built in event model (unlike SharpSSH which mostly involves wrangling with Streams) that makes usage very easy.

As for the terminal emulation part... Granados is actually the core of another open source project called Poderosa.

Poderosa is a complete terminal emulator application that can connect to ssh, telnet and even your local cygwin install.

I haven't really dove into it's terminal emulation code at all, but it definitely does it quite well, so I'm sure you could easily pull out whatever code you need.

Adam Haile