iTerm2 通過堡壘機(jumpserver)登錄服務器


一、創建一個exp文件,例如 vim remote.exp

#!/usr/bin/expect

# 登錄跳板機
spawn ssh -g -A -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2]
expect {
"*Opt>*" {send "[lindex $argv 3]\r";exp_continue}
"*ID>" {send "1\r"}
}
interact

二、配置iTerm
打開Preferences -> Profiles 添加配置

send text的內容如下(4個參數內容如下)

/Users/l****u/ssh/remote.exp 端口  登錄堡壘機賬戶 堡壘機IP地址 目標服務器IP


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM