||Thread Tools||Rate Thread||Display Modes|
SSH2 login script does noe run
I use SSH2 on my devices and I`m trying to log in using login script I found on this site.
I must have done something wrong because when starting a session from Session Manager I am prompted for username and password in the session window. (not pop up boxes)
When I log out, the script suddenly runs and that gives me an error message since it it design for login.
Se the script here:
#$language = "VBScript"
#$interface = "1.0"
' turn on synchronous mode so we don't miss any data
crt.Screen.Synchronous = True
' Wait for a string that looks like "login: " or "Login: "
crt.Screen.WaitForString "ogin: "
' Send your username followed by a carriage return
crt.Screen.Send "My-username" & VbCr
' Wait for a string that looks like "password: " or "Password: "
' Send your password followed by a carriage return
crt.Screen.Send "My-password" & VbCr
' turn off synchronous mode to restore normal input processing
crt.Screen.Synchronous = False
So to clarify, in the sessions that you wish to use the script, you have:
You don't get this far yet, but for future note:
Have you also verified that the "username/login" prompt from the remote is actually "Login:" or "login:"?
You may need to change that to "sername" to handle "Username:" or "username:".
' Wait for a string that looks like "username: " or "Username: " crt.Screen.WaitForString "sername: "
|login , script , ssh2|
|Display Modes||Rate This Thread|