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
 









ubuntu使用ssh远程登陆操作ubuntu

上一篇:linux CentOs7系统安装-ActiveMq


下一篇:操作系统进程同步习题记录