So these instructions are for those OS’s.įirst – make sure you have SSH installed. Macs, Raspberry PIs and other computers with “Linux-y” interfaces work the same way. I don’t have a Windows computer, but they make it a little tougher to do this. To make this easy, you need to work with a bash-like interface. Sounds like a lot to do though… right? Nope! Turns out, its stupid simple to make all this happen automatically. SSH’s brilliant software will now route you through to the PI using both your ssh to the Cloud Computer and the ssh from the Raspberry PI!!! To do this, you just need to tell it *where* to send your traffic to, in this case, localhost:2500. Proxy means, to ssh into a 3rd computer through the current ssh connection. All you have to do, is ssh to the Cloud Computer and tell your ssh client to Proxy through to the PI at port 2500 (represented at step 5). Lucky for you, you’re smart, and you setup the PI to do this forwarding magic when it boots. Relegated to an entirely different WiFi access point. Sadly, you are very far away from your poor PI. You are the hapless admin that would like to get access to the PI. Now… we jump over to you at “4” in the diagram. It makes connections to machines elsewhere on the planet look as though their software is running on the host machine. This RemoteForward directive is incredibly cool. This means, if software on that “Cloud Machine” attempts to connect to port 2500 locally on that cloud machine, redirect all of that unadulterated traffic through to port 22 on the PI… all inside the ssh connection the pi just made. The SSH client on the Raspberry PI, requests a “RemoteForward” of a port, say 2500, to the Raspberry Pi’s port 22. Next, after the ssh connection is established at “3” in the diagram. ![]() Just like the connections you make to websites. Note that it is able to communicate through the firewall at 2 without doing anything weird because this is an outgoing connection. When the raspberry pi gets a network connection, it SSH’s into the “Cloud Computer” this is represented by the “1” in the diagram. To break down the whirlwind I explained above. ![]() So lets just do it, and you can think about how this magic works elsewhere. SSH has built-in functionality to simply use that port as though I were ssh’ing directly onto the host. Its there just to host the port from the PI for exactly this type of connection. I ssh into it by using something called a Remote Proxy. Now, I want to get to that little PI running in a foreign network. When the ssh session is established, the raspberry PI remote-forwards its own SSH port from ec2-jump at a pre-defined port… say 2800. Ec2-jump is a host for which the raspberry pi already has ssh keys on disk. Once it gets it, the raspberry PI will ssh into a known host on the internet – lets call this host ec2-jump. ![]() The way this works – you setup your PI to wait for a network connection. To get around this is a wonderful tool called SSH Tunneling. Normally this is impossible because incoming connections are blocked by firewalls, or its simply a pain to keep track of a dynamically changing IP. Another use-case – as a professional, deploying a bit of software, or hardware, and you’d like to get metrics from it, or check in on its performance, or even – you’d like to install something after the box is in place. Or you just want to share a TMUX between your kids and their friends. Say you are helping a remote friend play with a pi. Sometimes you need your little linux box to be available for login even while it lives on foreign networks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |