x-shell 通过堡垒机连接 ssh多个机器 自动化脚本
大家好,我是烤鴨:
1. 連接vpn
這一步就沒什么說的了。我們用的easyconnect。登錄后彈出堡壘機頁面。
easyconnect 官網:https://sslvpn.zjweu.edu.cn/com/installClient.html
2. ?登錄堡壘機賬號
?
登錄堡壘機之后,如圖,點擊ssh鏈接。
?
3. ?用 x-shell 模擬網頁直接登堡壘機
配置地址和用戶名密碼。
4. ?ssh到其他的機器
其實能登錄到堡壘機就已經可以登錄其他的機器了。
如果我們想直接跳到那臺機器,不自己輸入ssh的那些命令。
如圖所示,就按照提示一步步寫登錄腳本就好了。
5. ?貼一下我的登錄腳本
expect?? ??? ??? ??? ??? ??? ??? ??? ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?send?
Select server:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1
Input account:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? xxxxxx
wanxxxxxxxxin@xx.xxx.xx.35's password:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?xxx#rfc
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ssh xxxx@xx.xx.xx.47
Are you sure you want to continue connecting (yes/no)?? ? ? ? ? ? ? ? ? ? ? ? ? yes
wanxxxxxxxxin@xx.xx.xx.47's password:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?xxx#rfc
6. ?貼一下我的數據庫登錄腳本(就是多了登錄mysql的操作)
expect?? ??? ??? ??? ??? ??? ??? ??? ??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?send?
Select server:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1
Input account:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? xxxxxx
wangxxxxxxxin@xx.xxx.xx.35's password:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?xxx#rfc
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ssh xxxx@xx.xx.xx.47
Are you sure you want to continue connecting (yes/no)?? ? ? ? ? ? ? ? ? ? ? ? ? yes
wangxxxxxxxin@xx.xx.xx.47's password:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?xxx#rfc
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mysql -uroot -h 127.0.0.1 -p
Enter password:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? root1234
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? use database_name;
總結
以上是生活随笔為你收集整理的x-shell 通过堡垒机连接 ssh多个机器 自动化脚本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 高仿带感魔性病毒源码+成品(最近很火的)
- 下一篇: springcloud gateway