问题
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