I want to connect to a Dell X1008 Switch and run some commands. I have used C# Tamir.SharpSsh and Renci.SshNet libraries.
using Tamir.SharpSsh;
SshExec exec = new SshExec("ip address", "username", "password");
exec.Connect();
var output = exec.RunCommand("show vlan");
exec.Close();
But my code freezes on "exec.RunCommand("show vlan")" line.
using Renci.SshNet;
using (var client = new SshClient(Host, UserName, Password))
{
try
{
client.Connect();
}
catch (Exception ex)
{
throw;
}
var command = client.CreateCommand("show vlan");
return command.Execute();
}
Here my code freezes on "var command = client.CreateCommand(cmd)" line.
Can anyone has idea about it?
FYI : Above code works well for Cisco switches.I can connect to Dell and Cisco switches by Putty software and I am able to run the commands from putty. My requirement is to run the commands from C# application.
Regards
Ravi