2

I'm trying to automate an SSH connection to a server from a windows box. I would like to ssh to the server, log in (using password not certificate), execute a few commands, read their output, then close the connection.

What would be the best way to accomplish this? Are there any C# libraries, or command line SSH clients that could be called from C#? It doesn't have to be C#, whatever works will be fine.

3 Answers 3

4

If you want something free, reliable, open-source. get PuTTY - Plink is especially friendly for programs.

Sign up to request clarification or add additional context in comments.

5 Comments

so what? the code is actively worked upon; this guy is a developer, not some end user noob, I'm sure he knows how to checkout from SVN.
would you like to live in the house which is actively worked upon?
I guess you're not interested in what I'm saying; I already pointed out that it is actively worked upon, just that they don't release pre-compiled binaries frequently.
indeed I am interested in OP getting the objective picture, and the picture is that the product is updated once in 4 years.
As of today, Sharp SSH 1.1.1.13, last update on 2013-05-28, Putty 0.64 last update on 2015-02-28. Take your choices.
2

If you need it free, SharpSSH is the most known (although not the most frequently updated). There was a recent rewrite of SSH client in C#, somehere on sourceforge, but I don't remember it's name and can't find it at the moment. Update: it's DotnetSSH.

There also exist several commercial solutions, which include vendor-provided support and timely updates. Our SSHBlackbox package is one of the options.

3 Comments

I'll try and convince the higher ups to give you guys some money, but this is a small project. Thanks for the suggestions.
I also found these for anyone who comes here by google: sourceforge.net/projects/opensshwindows sourceforge.net/projects/dotnetssh
@Petey Mind the GPL license of opensshwindows . DotnetSSH is the one I was thinking about (I'll update the answer with the link now).
1

There are several libraries to do this - for example http://www.rebex.net/ssh-pack/default.aspx (not affiliated, just happy customer) or http://www.eldos.com/sbb/ (not affiliated, just happy customer)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.