Reputation: 3600
I am using commands to connect to remote server using ssh
spawn ssh userId@host
expect "password:"
send "password\r"
Issue is sometime,even before shell prompt for password, send command is run which result's in password getting display in plain text on console.
It there a way to
*******
and not plain textI read the documentation of send
but no luck there.
Upvotes: 0
Views: 1201
Reputation: 337
You can hide output from console ussing stty
or log_user
.
Using stty
spawn ssh userId@host
expect "password:"
stty -echo
send "password\r"
stty echo
Using log_user
spawn ssh userId@host
expect "password:"
log_user 0
send "password\r"
log_user 1
Upvotes: 1