Reputation: 11569
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.
Upvotes: 2
Views: 2336
Reputation: 46080
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.
Upvotes: 2
Reputation: 3529
If you want something free, reliable, open-source. get PuTTY - Plink is especially friendly for programs.
Upvotes: 4
Reputation: 70379
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)
Upvotes: 1