I am trying to send an ssh command with C# but I'm getting an error for the SshClient. What namespace reference do I need so that it is accepted? Do I need to install Openssh on the Microsoft server?
I'm open to other suggestions if you have a better way to send a command. It's a very simple script:
using (var client = new SshClient("IP", "username", "password"))
{
client.Connect();
client.RunCommand("the command I'd like to run");
client.Disconnect();
}
Hi Daniel,
You could use the library sshnet (Renci.Sshnet).
You will need to copy the DLL to the folder C:\Skyline DataMiner\ProtocolScripts
More details about how to reference DLLs can be found in DataMiner Help - Adding Csharp code to an automation script
Hi Daniel,
You will need to install the SSH.Net nuget package and add a reference to the Renci.SshNet namespace by adding "using Renci.SshNet;" on top of your script.
Depending on your requirements, it might be more useful to move your SSH communication to a driver. More information on this can be found in our development guide here.