Configure the SSH Client (Your MacBook)

Once the OS installed and logging in via SSH using your external IP is successful, I opted to throw my computer screen and peripherals in the bed of my truck and back them into the lake, since everything can just be done remotely from your MacBook now.

Give Your IP Address a Name

We’re first going to set up an alias for our external IP so we don’t have to keep typing that everywhere. So, on your MacBook, edit your hosts file:

sudo nano /etc/hosts

and after all the entries in the file, give your IP address a name:

^ Hit CTRL+X, Y, then Enter to save the file and exit the editor.

Create SSH Keys and Send to the Server

Digital Ocean has a great tutorial on how to do this. For added security, complete the optional Step 4 as well. Upon completing this, you should now be able to SSH into your server, from your MacBook, without providing a password at all. Sweet!

Setup Tunnels for Geth-Related Ports

So, we’ve now got a secure way to login to our server from our MacBook only. Now we’re going to take that one step further and use that secure connection to set up a few “tunnels” in the background, so we can interact with our Geth node as if it were running directly on our MacBook.

There are several ways to achieve this, but I’m just going to be verbose about it for the sake of…verbosity……..

On our Mac:

sudo nano /etc/ssh/ssh_config

^ Note how we can just use our IP’s alias as the Hostname.

Notice the port numbers I chose for each connection. Geth’s default RPC port is 8545, but you can change this if you’d like. To keep it simple, I just remember that I’ll keep the Mainnet on the default port, the Testnet (Ropsten) on the next port, and the PoA net (Rinkeby) after that. But go with whatever works for you.

Schedule a Cron Job to Connect Every Minute

We said we wanted those tunnels to just be set up in the background. It would be a pain to have to remember to manually establish the connection before we use our Geth node remotely, so let’s just create a quick ‘n dirty cron job to attempt to connect every minute instead!

On our Mac:

export EDITOR=nano crontab -e

Hint: you can redirect the output to a file instead of /dev/null for debugging purposes

Install Go Ethereum for Mac

Follow this guide to install Geth on your Mac. No need to actually run it — we’ll just be “attaching” the Geth console to an instance running on the server. You technically don’t have to do this at all, if your end-goal is to just use something like MetaMask with Chrome on your laptop.

That’s it for the client-side! We’ll come back and test things after getting our Geth nodes up and running.