打开~/.ssh/config文件,如果没有则新建一个

输入以下内容并保存:

Host dxx.sxx-bastion                # jumpserver name
    hostname 54.65.xx.2xx           # jumpserver ip
    Port 18330                      # jumpserver port
    User ec2-user                   # jumpserver user name
Host dxx.sxx-web1                   # target server name
    hostname 10.0.x.xx              # target server ip
    ProxyCommand ssh dxx.sxx-bastion -W %h:%p  # ProxyCommand 
    User ubuntu                     # user name

在你本地完成上述配置以后,就可以在本机通过ssh命令直连到dxx.sxx-web1机器了(不用先登录到jumpsever然后再连接target server了)

ssh -u ubuntu@10.0.x.xx

相关文章:

  • 2022-01-26
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-08-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-01-31
  • 2021-07-08
  • 2021-07-08
相关资源
相似解决方案