linux 自动登录脚本
2015-08-25 17:38
766 查看
#!/usr/bin/expect set port 22 set user xiaoming set password xiaoming123 set host 111.222.22.33 set time 30 set timeout $time spawn ssh -p $port $user@$host expect { "yes/no" {send "yes\r"} "*password:*" {send "$password\r"} } expect eof interact #执行时不要用sh 要用expect expect file or ./file
相关链接:http://blog.sina.com.cn/s/blog_5140741f01015w3j.html
相关文章推荐
- Linux下查看/管理当前登录用户及用户操作历史记录
- 开发笔记-Linux-MySQL
- linux如何安装jdk
- linux多进程通信
- 修改linux最大文件句柄数
- Linux中tar命令详解
- centos源码方式安装ipython2.7,setuptools、pip并解决ipython不能不能使用方向键的问题
- 【Linux命令详解】7、Linux文件信息―(stat)
- Linux防火墙(Iptables)的开启与关闭
- Linux内核设计与实现--学习笔记--第三章- 2(init进程)
- 如何在arm linux平台连接ios设备
- linux sed command record
- Linux的文件系统
- laravel5 centos6.4下的配置体验
- Linux expect 特殊字符处理
- Linux学习5_Linux 下hosts文件详解
- Linux操作系统定时任务系统Cron入门、PHP计划任务以及rpc示例
- 哪款Linux发行版是你的最佳选择呢?
- linux内核配置入门
- centos添加批量添加ip提示无效参数