expect用法

#!/usr/bin/expect
spawn ssh -XY [email protected]
expect "[email protected]'s password:"
send "loongson\r"
interact

-----------------

然后可以把上述文件拷贝到/usr/bin/目录下,加上可执行权限即可。。。

你可能感兴趣的:(expect用法)