📜  ssh.net sshpass - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:43.503000             🧑  作者: Mango

代码示例1
SshClient client = new SsClient(IP_server, username, password);
client.Connect();
var commandToSend = client.CreateCommand("sshpass -p \"password\" sudo iptables -L");
commandToSend.Execute();
string response = commandToSend:Result.ToString();
Console.WriteLine("Response: " + response);