the usage of linux command "expect"
Linux The of quot Command Usage expect
2023-09-14 09:08:51 时间
#! /usr/bin/expect -f
# this script is used to practise the command "expect"
#when "lindex" have been used here, the array index begins with 0 but not with 1
set user [lindex $argv 0]
set host [lindex $argv 1]
set passwd [lindex $argv 2]
set timeout 10
spawn ssh $user@$host
# expect "[yes/no]" {send "yes\r"} if 'ssh-ing' a server for the first time,
# you most likely encounter the case above concerning RSA
expect "password:" {send "$passwd\r"}
interact
# modify the script mode to be 0744
# now, one runs "./login.exp your_name host_name your_passwd" in the bash shell, logging in the server successfully.
相关文章
- [Android Pro] 完美解决 No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
- 【工具记录】Linux口令破解
- linux驱动开发--中断:tasklet实现中断底半部
- linux - mysql:安装mysql
- linux内核数据结构之kfifo
- 鸟哥笔记-专题一:Linux文件的权限rwx、特殊权限sst、隐藏权限ia
- [Linux] Search the contents of files using grep
- Linux内核调优之Sysctl研究(原创)
- linux deepin/ubuntu 搭nginx文件服务器配置
- Docker: the Linux container engine
- No space left on device you must specify the filesystem type--Linux重启挂在失败
- 【Linux 内核 内存管理】虚拟地址空间布局架构 ⑤ ( Linux 内核中对 “ 虚拟地址空间 “ 的描述 | task_struct 结构体源码 )
- Qt开发,跨平台,区分windows和linux
- Linux 批量修改文件名
- linux分区
- Linux shell 脚本攻略学习笔记八
- RTX30系列linux+docker容器的GPU配置(tensorflow-gpu==1.15~2.x、tensorrt 7、cuda、cudnn)附加resnet50模型测试