Skip to content

Instantly share code, notes, and snippets.

@alinaselega
Last active April 6, 2021 14:34
Show Gist options
  • Save alinaselega/1062415417418c26f764dc4a88a984ee to your computer and use it in GitHub Desktop.
Save alinaselega/1062415417418c26f764dc4a88a984ee to your computer and use it in GitHub Desktop.
A short guide to ssh connection from one machine to another on a local network.

I keep forgetting how to debug ssh connection problems from one local machine to another (in my case, my laptop). This short guide lists the steps to successfully connect but it assumes that the pre-requisite requirements are already satisfied.

Specifically, both machines need to be on a local network managed by ZeroTier One. Note that after a restart, the zerotier application needs to be started again on a Windows machine. (I need to double check whether zerotier starts automatically on my Linux machine but I didn't have to start it again just now.) The ssh keys need to be set up on both machines accordingly. Both of my machines have tmux installed and the "remote" local machine (the one I am connecting to i.e. my laptop) has a host nickname (remote-host below) set up in .ssh/config on my "local" local machine.

Steps:

  1. Check if the zerotier application is running. If not, start it.
  2. Check if the sshd server is running (on the WSL) with:
service ssh status

If it isn't, restart with:

sudo service ssh restart
  1. Connect with the following provided sshtmux is defined in .bashrc:
sshtmux remote-host sess-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment