cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
932
Views
0
Helpful
4
Replies

TCLSH ssh from switch to switch

 

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

4 Replies 4

omz
VIP Alumni
VIP Alumni

try...

 

\r

Carriage return

 

send “$password\r”

 

 

omz
VIP Alumni
VIP Alumni

you can also do - 

expect "*assword: "

send "$password\r"

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

 

 

 

 

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 ?