I want to get output with one command line in private host through bastion server using one key pair

走远了吗. 提交于 2020-01-06 05:27:07

问题


I want to get output with one command line in private host through bastion server using one key pair. Referencely, bastion server and private host share one key pair and key pair is in my local macbook.

How can I get an output (ex. ls) on my local macbook with one command line?

mac > bastion > private ip host (I want to output of ls command)

enter image description here


回答1:


You could do it by using a ProxyJump in your .ssh/config, for example:

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

This will allow you to do:

$ ssh private.host ls /

Or without modifying your config file you could use something like:

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


来源:https://stackoverflow.com/questions/51505714/i-want-to-get-output-with-one-command-line-in-private-host-through-bastion-serve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!