Thank you for speed response and your answer. Maybe another people need code that and i want post my code.
string pass = "YOUR SUDO PASSWORD" +"\n\r" ;
byte[] passBuff = Encoding.ASCII.GetBytes(pass);
SshChannel channel = ssh.Session.OpenChannel(SshChannelType.Session, passBuff.Length);
channel.RequestPseudoTerminal();
channel.RequestExec("sudo ls");
channel.Send(passBuff, 0, passBuff.Length);
// process the command response
var response = new StringBuilder();
var buffer = new byte[4096];
while (true)
{
int n = channel.Receive(buffer, 0, buffer.Length);
if (n == 0)
{
channel.Close();
break;
}
response.Append(Encoding.Default.GetString(buffer, 0, n));
}
Console.WriteLine("info: {0}", response);