-2

I need to setup a static IP for 3rd parties to whitelist, and I need to use that IP from my laptop to connect to that 3rd party using SFTP and / or SSH.

I'm thinking that I need to create a static IP in google cloud, and then somehow setup a proxy that use that IP outbound.

How can I possibly set that up in Google Cloud?

Frederik
  • 99
  • 5

1 Answers1

1

All you need for this is a simple f1-micro instance with a static IP running any UNIX-like operating system.

I had an answer all written up, but then I found this gem which seems to perfectly and correctly do exactly what you want.

Just for fun, here are the two potential approaches I was going to suggest:

  • As two separate connections: you first SSH into the "proxy" instance, then SSH out from there; for convenience you can use SSH agent forwarding (in the Public Key Access with Agent Forwarding section, but I recommend reading it from the beginning; it's not that long).
  • One connection: You can tunnel directly using SSH; there's a Google Cloud Platform Community Tutorial on SSH tunneling covering it.
Alex
  • 523
  • 1
  • 4
  • 14
  • for the second option creating a tunnel - how would I bind a static IP to that? – Frederik Dec 19 '17 at 13:12
  • @gottlieb76 I recommend following the link behind the words "this gem" and using that instead. If you want to implement one of the other suggestions instead, you create the VM using a static IP; go into the Networking section of the VM details to select that. – Alex Dec 19 '17 at 13:14
  • I read through it, but it explains how to connect to a specific host (hostname or IP), however, I need to expose a static IP from the proxy, not connect to a specific host. – Frederik Dec 19 '17 at 13:15
  • @gottlieb76 You can connect to any host you want from it. The intermediate machine is the VM on GCP with the static IP. It isn't only for one destination! – Alex Dec 19 '17 at 13:17
  • I made sense of everything and got it working - thanks for the help. Much appreciated. I finally settled on the last option, the create a SSH tunnel - super simple once I figured it out. – Frederik Dec 19 '17 at 14:46