跳板机登录目标机与端口映射

ssh -i /home/p/SSVR.p root@47.93.189.16

 

1、配置ssh跳转登录 devA是跳板机,devB是目标机,配置文件如下:

# devA
Host devA
    HostName xx.xx.xx.x
    User root
    IdentityFile ~/.ssh/devA
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no
    StrictHostKeyChecking no

Host devB
    HostName xx.xx.xx.xx
    User root
    IdentityFile ~/.ssh/devB
    ProxyJump devA
    GSSAPIAuthentication yes
    GSSAPIDelegatecredentials no

2、本地通过跳板机登录目标机

ssh devB

3、本地通过跳板机登录目标机,同时通过本地端口转发,实现本地与目标机的端口映射:

ssh -L 13306:localhost:3306 -L 5672:localhost:5672 devB

 

posted @ 2024-03-06 17:00  DW039  阅读(61)  评论(0编辑  收藏  举报