This project is read-only.

client.RunCommand() is not working

Apr 21, 2015 at 6:19 PM
Edited Apr 21, 2015 at 6:29 PM
 static void Main(string[] args)
        {
           PrivateKeyFile key = new PrivateKeyFile("private");
           using (var client = new SshClient("10.96.15.6", "admin", key))
            {
                client.Connect();
                client.RunCommand("xcommand dial number: 6712@XXXXXXXX.com");
                client.Disconnect();
            }
        }
The program hangs at the .RunCommand(). I am new to this, am i missing something really basic? It seems that this is the same code that works for other people and I know that the command is correct.

If I comment out the .runcommand() the program executes without error.

I appreciate any help in advanced.
Jul 13, 2015 at 2:10 PM
SshClient ssh = new SshClient(ip, 22, userName, password);
ssh.Connect();
SshCommand sshc = ssh.RunCommand("top"); // replace with your command