[shell] 上传key后用expect 实现大量机器ssh首次登录
2012-12-12 15:52
211 查看
1> ssh-expect.exp
2 do_ssh.sh
#!/usr/bin/expect set i [lindex $argv 0] set timeout 30 spawn ssh root@slave$i expect "(yes/no)?" send "yes\r" expect -re "\]($|#)" send "exit\r" interact
2 do_ssh.sh
#!/bin/bash for i in {01..03} do echo $i ./ssh-expect.exp $i done
相关文章推荐
- shell中嵌套expect实现ssh登录
- shell实现ssh自动登录远程主机
- shell脚本通过expect实现自动单边无密登录
- 更好的自动ssh登录,用公共key实现无密码ssh
- SecureCRT、SSH Secure Shell Client远程登录实现
- shell实现ssh自动登录远程主机
- 安装、设置和使用SSH Secure shell 实现windows 登录linux
- 无密钥登录的自动脚本实现(ssh-copy-id、expect免交互输入脚本)
- 教你如何配置linux用户实现禁止ssh登陆机器但可用sftp登录!
- 无密钥登录的自动脚本实现(ssh-copy-id、expect免交互输入脚本)
- 使用shell脚本自定义实现选择登录ssh
- Linux中使用expect脚本实现远程机器自动登录
- 用expect实现ssh自动登录对服务器进行批量管理
- python实现动态更新远程机器列表的SSH登录脚本
- Linux下实现SSH免密码登录和实现秘钥的管理、分发、部署SHELL脚本分享
- expect实现自动scp和ssh登录后执行命令,并向bash提供返回值
- 更好的自动ssh登录,用公共key实现无密码ssh
- expect实现ssh自动登录
- Linux_Shell 利用ssh, expect 在多个机器上执行指令
- shell脚本实现scp上传(expect交互),ftp上传