I would like to connect use ssh to connect to an other computer. Following you can see my code.
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.FileName = @"C:\Program Files (x86)\PuTTY\putty.exe";
startinfo.Arguments = "-ssh <user>@<domain> -pw <password>";
Process process = new Process();
process.StartInfo = startinfo;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.Start();
process.StandardInput.WriteLine("<command>");
process.WaitForExit();
Console.ReadKey();
With that I have two problems. Firstly, the command should wait until the connection is successful established. Secondly, the command is not shown in the cmd. I don't know if don't see the commands because it's not waiting until the connection is successful or it is just not working.
I really appreciate any help.