【问题标题】:I want to get output with one command line in private host through bastion server using one key pair我想使用一对密钥通过堡垒服务器在私有主机中使用一个命令行获取输出
【发布时间】:2019-01-01 11:52:29
【问题描述】:

我想使用一个密钥对通过堡垒服务器在私有主机中使用一个命令行获取输出。 作为参考,堡垒服务器和私有主机共享一个密钥对,密钥对在我的本地 macbook 中。

如何使用一个命令行在本地 macbook 上获得输出(例如 ls)?

mac > bastion > private ip host (我要输出ls命令)

enter image description here

【问题讨论】:

    标签: ssh ssh-keys netcat


    【解决方案1】:

    您可以通过在 .ssh/config 中使用 ProxyJump 来做到这一点,例如:

    Host private.host
      ProxyJump <user>@bastion.host
    

    这将允许您这样做:

    $ ssh private.host ls /
    

    或者在不修改配置文件的情况下,您可以使用以下内容:

    $ ssh -J bastion.host private.host ls /
    

    【讨论】:

      猜你喜欢
      • 2016-10-31
      • 2016-10-31
      • 2017-10-20
      • 1970-01-01
      • 2019-05-20
      • 2018-07-18
      • 2020-11-11
      • 2019-02-12
      • 2019-04-14
      相关资源
      最近更新 更多