I want to implement this scenario: On AWS, I have a VPC in which it has a public and private subnet deployed. On the public subnet, I have an instance of "bastion", while on the private subnet there is one node that runs some services (an instance of the AKA service). Using the * nux ssh command, I can do this to connect to the "service instance" from my local laptop:
ssh -t -o ProxyCommand="ssh -i <key> ubuntu@ <bastion-ip> nc %h %p" -i <key> ubuntu@ <service-instance-ip>
I have a Go program and want to do the following:
- ssh connect to the "service instance" from the "local laptop" above the "bastion"
- use a connection session to run some commands (for example, "ls -l")
- Uploading files from the local laptop to the โservice instanceโ
I tried, but could not implement the same process as doing
ssh -t -o ProxyCommand="ssh -i <key> ubuntu@ <bastion-ip> nc %h %p" -i <key> ubuntu@ <service-instance-ip>
Can someone help show me an example? Thanks!
By the way, I found this: https://github.com/golang/go/issues/6223 , which means that he is definitely capable of doing this, right?
source share