linux ssh及ProxyCommand

主配置文件

~ > cat .ssh/config                                                                      11m 44s 14:10:23
Include ~/.ssh/config.d/bingo/hk
Host server1
    HostName 103.235.232.11
    User lifei
    Port 22
    IdentityFile ~/.ssh/keys/server1
Host server2
    HostName 103.235.232.16
    User root
    Port 22
    IdentityFile ~/.ssh/keys/server2

子配置文件

Host client1
    HostName ip3
    Port 22
    User root
    IdentityFile ~/.ssh/keys/client1
Host client2
    HostName ip2
    Port 22
    User root
    IdentityFile ~/.ssh/keys/client2

Host client-switch-*
    User lifei
    Port 2190
    ProxyCommand ssh client1 -W %h:%p
###########################
# Switch
###########################
# password: *******
###########################

Host client-switch-1
    HostName 10.221.0.254
posted @ 2022-02-18 14:15  lifei888  阅读(468)  评论(0)    收藏  举报