ssh config 跳板机可以直接跳过

核心 ProxyCommand
Host gateway
    HostName $GATEWAY_HOST
    Port $GATEWAY_PORT
    IdentityFile ~/.ssh/id_rsa
    User $GATEWAY_USER

Host target
    HostName $TARGET_HOST
    User $TARGET_USER
    IdentityFile ~/.ssh/id_rsa
    ProxyCommand ssh gateway nc %h %p 2> /dev/null # 或者 ProxyCommand ssh gateway -W %h:%p
posted @ 2023-01-16 08:54  vx_guanchaoguo0  阅读(24)  评论(0编辑  收藏  举报