.Net class to execute remotely on Linux over SSH?

2020-07-18 09:05发布

问题:

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!

回答1:

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/


标签: c# .net linux ssh