使用ssh配置跳板机
时间:2022-01-17 14:24:07 +0800 CST 浏览:1826

简单的修改/etc/ssh/ssh_config文件即可通过跳板机,直达目标服务器。

配置方法

cat /etc/ssh/ssh_config

TCPKeepAlive yes
ServerAliveInterval 60
ServerAliveCountMax 3

Host jump-server
    User xxxx
    Hostname yyy.yyy.yyy.yyy
    IdentityFile <youer file path>
    Port 22

Host 10.*
    ProxyCommand ssh -q -W %h:%p jump-server

Host 支持通配符 *?

xxxx 跳板机用户名

yyy.yyy.yyy.yyy 跳板机IP地址

需要注意的问题

跳板机最好是免秘钥登录,不然的话会需要输入密码。



如果这篇文章对你有所帮助,可以通过下边的“打赏”功能进行小额的打赏。

本网站部分内容来源于互联网,如有侵犯版权请来信告知,我们将立即处理。


来说两句吧