script/proxy.sh-22 #8
19
script/proxy.sh-22
Executable file
19
script/proxy.sh-22
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set IPandPort "0.0.0.0:2080"
|
||||
#set username "root"
|
||||
set username "zhang"
|
||||
#set remoteHost "104.224.157.48"
|
||||
set remoteHost "172.20.20.22"
|
||||
set password "zhang"
|
||||
set rport "7001"
|
||||
set timeout -1
|
||||
#autossh -M 1111 -p 20002 -N -D 0.0.0.0:1080 root@104.224.157.48
|
||||
spawn autossh -M 1122 -p $rport -N -D $IPandPort $username@$remoteHost
|
||||
|
||||
while true {
|
||||
expect {
|
||||
"(yes/no)" { send "yes\r"; exp_continue }
|
||||
"assword:" { send "$password\r"; puts \r;set DATE [exec date "+%F %H:%M:%S"]; puts "$DATE\r" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user