To give you the best experience, this site uses cookies. Continuing to use 9bis.net means you agree to our use of cookies.
 

English version Russian version Version française Nederlandse versie Versión española Version portuguese Version polonaise Italian version Versiunea româna   KiTTY News

KiTTY : Forum

Last modification : -

KiTTY web site




Forum Home
 

Fully automatic session

Aramil - Mon 01/12/2014 12:16:15 CET +0100

Hi
I'm trying to switch device setting with script. I can log in to this device with telnet or SSH. Is there a way to get past second password question? Actually i can't break through this - device needs a confirmation of password in one point.

I'm trying to create something like this:
//login to device (telnet or ssh)
//login question
login
//password question
password
command1
//password question
password
command2
command3
//close session

I was also thinking about doing this as C# command line program, but my skill are only good enough to understand existing code not to write my own.

I'll be glad for any tips.

Aramil - Mon 01/12/2014 12:51:59 CET +0100

Ok, sorry to bother you. I was just making excessive space between commands. Bad habit from programming learning...
It works correct with shortcut like that:
"C:\kitty_portable.exe -ssh admin@1.1.1.1 -pw pass -cmd cmd1\npass\cmd2\nx\nx"

moatamedi - Sat 13/12/2014 15:41:13 CET +0100

Hi

First thanks a lot of professional KiTTY!

when i use this in c# to login in a Cisco swtich:
     kitty.exe -ssh admin@1.1.1.1 -pw pass -cmd enable\nEnablePass\n
kitty return error: Unable to open connection to ....

but when i use that in cmd it works GOOD :)

Here is my Code:
     string PATH = @"" + Application.StartupPath + "\\kitty";
     string KITTY = PATH + "\\kitty.exe";
     string CMD = "enable\n" + SECRET + "\n";
     string PARAM = " -" + rAccess.ToLower() + " " + USERNAME + "@" + HOST + " -pw " + PASSWORD + " -cmd " + CMD;
     Process proc = new Process();
     ProcessStartInfo startInfo = new ProcessStartInfo();
     startInfo.CreateNoWindow = false;
     startInfo.RedirectStandardInput = true;
     startInfo.UseShellExecute = false;
     startInfo.FileName = KITTY;
     startInfo.Arguments = PARAM;
     proc.StartInfo = startInfo;
     proc.Start();

PLZ Help
thank you ;)

moatamedi - Sat 13/12/2014 16:07:44 CET +0100

Hi Again

I find this damn for auto logon to Cisco Devices:

     string CMD = "enable\"\n" + EnablePass + "\"\n"; //use this template exactly and put your Enable Password
     kitty.exe -ssh admin@1.1.1.1 -pw pass -cmd CMD;

moatamedi - Sat 13/12/2014 17:13:53 CET +0100

Hi Again X2

in C#:
     string CMD = "enable\\n" + EnablePass + "\\n"; //use this template exactly and put your Enable Password
     kitty.exe -ssh admin@1.1.1.1 -pw pass -cmd CMD;




Answer


The forum is actually closed