mac 安装brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

mac安装expect(需要先安装brew,没有安装的话看上边)

brew install expect

 

mac一键登录服务器脚本

 

set user "zhaohh"

set host "123.126.105.34"

set password "haizhi1234!"

set timeout -1

 

spawn ssh $user@$host

expect "*assword:*"

send "$password\r"

interact

expect eof

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄