SSH Login Shell
2015-12-08 10:44
591 查看
how to login into a remote host through ssh
1, write a shell script (login.sh), like:
#!/usr/bin/expect -f set user root set host 192.168.2.1 set password yourpasswd set timeout -1 spawn ssh $user@$host expect "*assword:*" send "$password\r" interact expect eof
2, run the following command in a terminal
#this will run the shell script expect ./login.sh
3, you can even do this with iTerms2
iTerms is a great alternative for the built-in terminal on MacOS. You can add in many sessions.相关文章推荐
- shell遍历目录下所有文件
- shell基础学习链接
- Shell
- shell脚本中整数值比较
- sublime 调用 shell
- shell学习
- ubuntu 开机出错disk by-uuid ########### does not exist dropping to a shell
- 【Unix/Linux编程实践】shell如何运行程序—编写命令解析器sh
- shell 1变量注意点
- Linux Shell 命令学习二-----------apt-get指令的使用
- shell 基础
- linux下shell显示-bash-4.1#不显示路径解决方法
- [Bash Shell] Shell学习笔记
- shell脚本中head命令的使用
- shell 后台执行程序命令
- shell取消键盘回显
- shell之RDS备份+判断是否传输完成
- 使用shell定时自动备份mysql数据库
- 老李分享:《Linux Shell脚本攻略》 要点(八)
- shell中${##%%}代表啥,备忘