×

操作系统

shell脚本模拟ssh登录

穆琪 穆琪 发表于2020-05-10 浏览888 评论0
1、背景使用mac的终端直接ssh,但是每次都要输入密码,不堪其扰,我就想到了用shell脚本写出一个替我自动输入密码的一个脚本。这个脚本应该也适用于Linux。2、源码ssh_login.expect#!/usr/bin/expect set ssh_name [lindex $argv 0] set timeout 1 if {$ssh_name == ""} {