2613

ubuntu下ssh链接shell脚本---expect

乐果   发表于   2015 年 08 月 09 日 标签:ubuntushell

一、安装expect

sudo apt-get install expect

二、shell脚本文件,例:

#!/usr/bin/expect -f
set port 22
set user root
set host 120.24.165.125
set password *******
set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
#expect eof

乐果   发表于   2015 年 08 月 09 日 标签:ubuntushell

0

文章评论