Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net class to execute remotely on Linux over SSH?

Tags:

c#

.net

linux

ssh

I'm not sure where to get started with simply executing a remote script and returning the output to a web form. In this case we have an application server that executes some 3rd party tools. We'd like to write an interface for our power users that allow them to check the status of various processes and also execute some of the 3rd party admin tools that support has available. The issue is that we only connect to this Linux (RedHat) machine via Putty over SSH. I looked into PsExec but it doesn't seem to handle SSH. I'd like to avoid any large security holes, if possible, but this is intended to be a limited number of users in a closed network. Thanks for any assistance getting started!

like image 765
McArthey Avatar asked Oct 11 '22 02:10

McArthey


1 Answers

There are several options to do SSH in .NET - although you need a library for that since nothing is built-in:

  • http://www.codeproject.com/KB/IP/sharpssh.aspx
  • http://www.rebex.net/ssh-shell.net/ (commercial)
  • https://www.eldos.com/sbb/net-ssh.php (commercial)
  • http://sshnet.codeplex.com/
  • http://granados.sourceforge.net/
like image 127
Yahia Avatar answered Oct 13 '22 20:10

Yahia