cisco FWSM firewall executing command

Oct 27, 2011 at 1:56 PM
Edited Oct 27, 2011 at 1:57 PM

hi,

i have cisco fwsm firewall and installed ssh2 server.

i connected the server but not executing command.

 

   PasswordConnectionInfo info = new PasswordConnectionInfo("host",22,"username", "passw");
            using (var client = new SshClient(info))         

  {             

  client.Connect();                 

            if (client.IsConnected)             

    {                   

  Console.WriteLine("Connected");

                SshCommand cmd = null;     

                       cmd = client.RunCommand(string.Format("Show Ver"));           

        Console.WriteLine("Result:");           

        Console.WriteLine(cmd.Result);
             }               

     else Console.WriteLine("not connected");                

    client.Disconnect();               

   Console.WriteLine("connection closed.");         

 }

 

i cant get the result of commant anyway.  

what must i do? 

thanks.

Nov 4, 2011 at 1:16 PM

Hi

Check cmd.Error and cmd.ExitStatus, does this help?