mac笔记本自动ssh 登录linux脚本

#!/usr/bin/expect

#set timeout 30

spawn ssh username@ipaddr  

expect "Password:"

send "$password\r"

expect "Select group:"

send "/$172.0.0.1\r"

expect "Select account:"

send "4\r"

interact

 

#命令模式根据实际修改。

posted @ 2023-11-08 16:19  grape_lee  阅读(38)  评论(0编辑  收藏  举报