简单的修改/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地址
跳板机最好是免秘钥登录,不然的话会需要输入密码。
如果这篇文章对你有所帮助,可以通过下边的“打赏”功能进行小额的打赏。
本网站部分内容来源于互联网,如有侵犯版权请来信告知,我们将立即处理。