How to access remote systems over Meshnet using SSH
Discover the best practices for accessing remote systems securely over Meshnet using SSH, including key-based authentication.
With the advancement of technology, remote system management has become crucial in today's digital landscape. Secure Shell (SSH) is a popular choice when it comes to accessing remote servers, desktop computers, and devices like Raspberry Pi due to its flexibility and efficiency. While the client-server architecture of SSH makes communication between devices secure, it is not completely risk free, especially if you rely on password authentication.
Used in conjunction with Meshnet, the SSH method can be as safe as physically accessing the server. Not only does Meshnet save time and travel costs, allowing you to connect directly to your remote device, but it also protects your SSH connection. Using an SSH key pair to authenticate your identity provides an additional layer of security by reducing the risk of password-based attacks.
This article explains what an SSH connection is, how it can be established via Meshnet, and how you can generate an SSH key pair to additionally protect the connection.
SSH is a command-line access method that lets you log in to another computer, execute commands, and transfer files between computers.
Being a lightweight protocol, SSH is typically used for remote server administration and is especially prevalent in the Linux infrastructure.
While SSH is mostly used for controlling Linux machines, both Windows and macOS can also be accessed using this method. All three operating systems employ an open-source implementation of SSH tools called OpenSSH server.
To make your device accessible via SSH, you need to install and enable the OpenSSH server software.
Linux
Windows
macOS
Note
In this guide, Ubuntu 22.04.1 LTS serves as the example for the provided instructions.
To install SSH server on Linux:
- 1.Open the terminal and install the SSH server by running this command:sudo apt update && sudo apt install openssh-server
- 2.Once the installation is complete, confirm that the SSH service is running by checking its status. The output should tell you that the service is active. Run the following command:sudo systemctl status ssh
- 3.To prevent the firewall from blocking your remote connection, open the SSH port by typing:sudo ufw allow ssh
You can now connect to your Linux system via SSH from any remote device over Meshnet.
To enable SSH on Windows, complete the following steps:
- 1.Open Settings, select Apps, and click Optional features.
- 2.Click View features.
- 3.Type in
OpenSSH
, select the OpenSSH Server checkbox, and click Next. - 4.Click Install.
- 5.Once the installation is finished, open PowerShell as an administrator by pressing the Windowskey + R, typing in
powershell
, and pressing Ctrl + Shift + Enter. - 6.Run the following command to start the OpenSSH server process:Start-Service sshd
- 7.Ensure the SSH service is enabled each time you reboot your computer using this command:Set-Service -Name sshd -StartupType 'Automatic'
You can now connect to your Windows machine via SSH from any remote device over Meshnet.
To connect to your Mac using SSH, you need to enable remote login in your system settings.
- 1.Choose the Apple menu> System settings > General, and click Sharing.
- 2.Enable the Remote login option.
- 3.If needed, select the Allow full disk access for remote users checkbox on the right.
- 4.Optionally, specify which users can log in.
You can now connect to your Mac via SSH from any remote device over Meshnet.
Before attempting to connect, ensure that you have the correct username for the remote computer account.
Tip
To view your username, run the following command in Command Prompt (on Windows) or Terminal (on Linux or macOS):
whoami
Windows, macOS, and Linux
Android
iOS
To access your remote system via SSH from a desktop device:
- 1.Open Command Prompt (on Windows) or Terminal (on Linux or macOS).
- 2.Enter the following command, where
<username>
is your remote PC account name and<server>
is the Nord name or Meshnet IP of the computer you want to access:ssh <username>@<server>Exampleor - 3.The first time you connect, you will be asked to verify the authenticity of the server. This message is displayed to make sure you’re connecting to the correct remote server. Type
yes
to continue, as shown: - 4.Enter the password for the specified username.
You should now be connected to your remote device using SSH.
To access your remote system via SSH from an Android device:
- 1.
- 2.Open ConnectBot.
- 3.Tap the plus (+) button to add a host device.
- 4.Under Protocol, enter the following information, where
<username>
is your remote PC account name and<server>
is the Nord name or Meshnet IP of the computer you want to access.<username>@<server>Example - 5.Tap the plus (+) button in the upper-right corner.
- 6.Tap the newly added host device to initiate a connection.
- 7.Enter the password for the specified username.
You should now be connected to your remote device using SSH.

To access your remote system via SSH from an iOS device:
- 1.
- 2.Open WebSSH.
- 3.To add a new host device, tap the empty area of the main screen or the plus button in the upper-right corner.
- 4.Specify the following information:
- In the Host field, enter the Nord name or Meshnet IP of the remote PC.
- In the User field, enter the account name of the remote computer.
- In the Password field, enter the authentication password of the user account.
- 5.Tap the check mark button in the upper-right corner.
- 6.From the main application screen, tap the newly added device to initiate a connection.
- 7.Tap Continue to confirm the host key fingerprint.
You should now be connected to your remote device using SSH.

An SSH key is a cryptographic key that is used for user authentication while establishing an SSH connection. It increases the security of SSH connections and allows for efficient automation, as it doesn't require human intervention for authentication.
To use key-based authentication, you first need to generate a key pair on the host device.
- 1.Run the following command in Command Prompt (on Windows) or Terminal (on Linux or macOS):ssh-keygen
- 2.Press Enter to keep the default file location.
- 3.For additional security, you can choose a custom password. Otherwise, press Enter.
A pair of keys (private and public) will be generated with the same
id_rsa
name. However, the public key can be distinguished from the private key by its file extension, which is .pub
.
To use SSH keys for authentication, you need to copy the public key of the host device to the client device. When establishing an SSH connection, the public key is matched with the private key on the host device to authorize the connection.
Windows
Linux and macOS
To exchange the SSH public key, follow these steps on your host device:
- 1.Open PowerShell.
- 2.Run the following command, where
<username>
is the username of the client device's account and<server>
is the client device’s Nord name or Meshnet IP:type $env:USERPROFILE\.ssh\id_rsa.pub | ssh <username>@<server> "cat >> .ssh/authorized_keys"Exampletype $env:USERPROFILE\.ssh\id_rsa.pub | ssh ubuntu@secret.meerkat-altai.nord "cat >> .ssh/authorized_keys" - 3.If prompted, type in yes and press Enter to confirm the key fingerprint.
- 4.Enter the client device’s account password and press Enter.
To exchange the SSH public key, follow these steps on your host device:
- 1.Open Terminal.
- 2.Run the following command, where
<username>
is the username of the client device's account and<server>
is the client device’s Nord name or Meshnet IP:ssh-copy-id <username>@<server>Examplessh-copy-id [email protected] - 3.If prompted, type in
yes
and press Enter to confirm the key fingerprint. - 4.Enter the client device’s account password and press Enter.
You will see a message that the key has been added.

Once the SSH key exchange is complete, you can use the same format to establish an SSH connection to the other device:
ssh <username>@<server>
However, you will not be prompted to enter a password unless you choose a passphrase while generating the SSH key. And now you can securely access your remote device via SSH over Meshnet.
Last modified 4d ago