自动连接的脚本
来源:互联网 发布:python递归函数怎么写 编辑:程序博客网 时间:2024/06/04 17:51
1 #!/bin/bash
2 read -p 'user:' USER
3 read -p 'ipaddr:' IP
4 ssh $USER@$IP
1 #!/usr/bin/expect
2 set USER [ lindex $argv 0 ]
3 set IP [ lindex $argv 1 ]
4 set PASSWD [ lindex $argv 2 ]
5 spawn /mnt/ssh.sh
6 expect {
7 "Are you sure" { send "yes\r"; exp_continue }
8 "user" { send "$USER\r"; exp_continue }
9 "ipaddr" { send "$IP\r"; exp_continue }
10 "password" { send "$PASSWD\r"; exp_continue }
11 expect eof
12 }
13 interact
~
2 read -p 'user:' USER
3 read -p 'ipaddr:' IP
4 ssh $USER@$IP
1 #!/usr/bin/expect
2 set USER [ lindex $argv 0 ]
3 set IP [ lindex $argv 1 ]
4 set PASSWD [ lindex $argv 2 ]
5 spawn /mnt/ssh.sh
6 expect {
7 "Are you sure" { send "yes\r"; exp_continue }
8 "user" { send "$USER\r"; exp_continue }
9 "ipaddr" { send "$IP\r"; exp_continue }
10 "password" { send "$PASSWD\r"; exp_continue }
11 expect eof
12 }
13 interact
~
0 0
- 自动连接的脚本
- 自动连接ftp脚本
- ssh自动连接脚本
- UBUNTU自动连接VPN脚本
- 自动启动或关闭网络连接的VBS脚本
- Ubuntu连接VPN的自动重连脚本
- Windows下自动连接WiFi 脚本
- expect用法[自动连接远程机器脚本]
- 脚本ssh连接自动填密码(expect)
- ssh连接失败自动重连脚本
- 自动构建的脚本
- 连接用户的脚本
- 所谓的自动执行sql脚本小程序,c/c++连接sybase
- 测试脚本自动运行的VBS 脚本
- 进行自动备份的脚本
- Oracle的自动启动脚本
- Linux的脚本自动 交互
- 数据库的自动备份脚本
- 微信小程序注册
- spring boot+JPA+easyUI 实现基于浏览器语言的国际化配置
- MongoDB 安装及启动
- 苹果账号续费以及过期更新问题
- 蓝牙耳机按键在Android侧的处理流程
- 自动连接的脚本
- TCP序列号和确认号详解
- 常用的mysql 语句
- 类型转换的四个关键字
- Servlet 实例
- RxJava 2.0的基本使用
- 【Linux】rpm常用命令及rpm参数介绍
- tablayout重写点击事件
- 十大Intellij IDEA快捷键