一栗精、填寫iterm2的配置文件
二闯参、在家目錄添加配置文件 ~/.ssh
- 新建配置文件
touch centos7
- 配置文件中添加一下內(nèi)容
#!/usr/bin/expect -f
set host 192.168.100.119(服務器ip地址)
set user root(登錄服務器的用戶名)
set password admin(登錄服務器的密碼)
#set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof