08-28-2018 02:47 AM - edited 03-08-2019 04:01 PM
I am trying to make a script that run tclsh, and can jump to several swicth via ssh, check a few parameters,befor jumping to the next one.
But I am unable to automat the transfere the password in the ssh session.
i am able to get the login, but the pasword isn´t transfered
ssh -l $user $IP
expect {[Pp]assword:} {
send “$password”
}
what am i doing wroung ?
the tcl version is 8.3.4
08-28-2018 02:57 AM
try...
\r |
Carriage return |
send “$password\r”
08-28-2018 02:58 AM
you can also do -
expect "*assword: "
send "$password\r"
08-28-2018 05:31 AM
Still don´t work :(
I'm relatively new in tcl is there any to debug ?
Contacting AUTHENTICATION Service ....
Password:
Password:
Password:
Password:
but if i do the script manually it works
@ssh -l $User $IP
and copy paste password manually in it works
i have check password by
puts "$password"
and that is corret, it looks like something is messing with the password, maybe it takes more then character alone and space after variable $password
09-12-2018 08:39 AM
Hi again
just Got around to check this a little more would like to know if it make any difference, running the script from a file or copy paste it in to tclsh ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide