I need your help. ssh connection was successful. I have checked this command -> Pass : pc1.RunCommand("echo '!123123' | sudo -S reboot")
So I tried other moves.
I need run linux shell script file.
remove : pc1.RunCommand("echo '!123123' | sudo -S reboot") add : pc1.RunCommand("cd ~/ryu/123.sh"); <--- not working
but this command not working. (in putty pass) Does anyone know how?
Thank you.
PasswordConnectionInfo info1 = new PasswordConnectionInfo("server ip", 22, "user", "password");
info1.Timeout = TimeSpan.FromSeconds(5);
SshClient pc1 = new SshClient(info1);
try
{
if (checkBox1.Checked == true)
{
pc1.Connect();
if (pc1.IsConnected)
{
pc1.RunCommand("echo '!123123' | sudo -S reboot"); <--- this command pass
pc1.RunCommand("cd ~/ryu/123.sh"); <--- this command not working
}