ubuntu使用ssh远程登陆操作ubuntu
作者:互联网
使用以下代码检测expect是否已经安装
ls /usr/bin | grep expect
如果显示为空,则使用以下命令安装
sudo apt-get install tcl tk expect
以下是示例脚本
#! /usr/bin/expect
spawn ssh crrc@192.168.10.192
expect "*password:"
send "abc.1234.2020\r"
expect "*#"
send "cd wal\r"
expect "*#"
send " mkdir test\r"
expect "*#"
interact
标签:bin,send,远程登陆,usr,ubuntu,ssh,expect 来源: https://www.cnblogs.com/wal1317-59/p/12773823.html