连接远程主机
连接远程主机
#!/usr/bin/expect
set user root
set host yourip
set password yourpass
spawn ssh $user@$host
set timeout 20
expect "*assword:*"
set timeout 20
send "$password\r"
expect "root@vultr:"
send "ssserver -c /etc/shadowsocks.json\r"
interact
expect eof
alias ssh_login="shell's path"
关注公众号:数据结构与算法那些事儿,每天一篇数据结构与算法