This project is read-only.

Issue trying to send a command via SSH to VMWare

Aug 16, 2013 at 7:51 PM
I'm able to run commands like "who" when testing, but when I try to run something like " restart" it just hangs. Running it using Putty works fine.

var connectionInfo = new KeyboardInteractiveConnectionInfo(host, username);
            connectionInfo.AuthenticationPrompt += delegate(object sender, AuthenticationPromptEventArgs e)
                foreach (var prompt in e.Prompts)
                    if (prompt.Request.Equals("Password: ", StringComparison.InvariantCultureIgnoreCase))
                        prompt.Response = password;

            using (var ssh = new SshClient(connectionInfo))
                var cmd = ssh.RunCommand(" restart");
Aug 22, 2013 at 4:17 AM
So I followed the example using CreateShellStream from here:

The problem is that it's based on stream.Length == 0 to determine that the command has completed, but in my case it's not. Is there a better way to detect that it's actually completed?
Sep 24, 2013 at 4:17 PM