转自:http://stackoverflow.com/questions/33337322/rz-fail-over-expect-auto-login-ssh
I use securecrt or xshell .
1. use securecrt or xshell login server.
2. rz -bye # upload file succ
3. gohost 127.0.0.1 # login one server or other server
4. rz -bye # upload fail
my gohost
code:
#!/usr/bin/expect
set ip [lindex $argv 0]
set password "mypasswd"
set timeout 10
spawn ssh $ip
expect {
"*yes/no" { send "yes\r"; exp_continue}
"*assword:" { send "$password\r" }
}
interact
but if ssh login, manual type password(without expect auto login), it is succ.
How should I do?
I find one server can rz succ.
so I compare two server linux env.
export LC_CTYPE=en_US
use this, the server can rz upload file succ