LogoLogo
DownloadBlog
  • Overview
  • Getting started
    • Meshnet explained
    • How to start using Meshnet
      • Using Meshnet on Windows
      • Using Meshnet on Android
      • Using Meshnet on iPhone/iPad
      • Using Meshnet on macOS
      • Using Meshnet on Linux
      • Using Meshnet on Android TV
    • How to use Meshnet securely
  • Features
    • Linking devices in Meshnet
      • Linking external Meshnet devices on Windows
      • Linking external Meshnet devices on Android
      • Linking external Meshnet devices on iPhone/iPad
      • Linking external Meshnet devices on macOS
      • Linking external Meshnet devices on Linux
      • Linking external Meshnet devices on Android TV
    • Explaining permissions
      • Remote access permissions
      • File sharing permissions
      • Traffic routing permissions
      • Local network permissions
    • Renaming devices in Meshnet
      • Renaming devices on Windows
      • Renaming devices on Android
      • Renaming devices on iPhone/iPad
      • Renaming devices on macOS
      • Renaming devices on Linux
    • Sharing files in Meshnet
      • Sharing files on Windows
      • Sharing files on Android
      • Sharing files on iPhone/iPad
      • Sharing files on macOS
      • Sharing files on Linux
      • Sharing files on Android TV
    • Routing traffic in Meshnet
      • Routing traffic from Windows
      • Routing traffic from Android
      • Routing traffic from iPhone/iPad
      • Routing traffic from macOS
      • Routing traffic from Linux
      • Routing traffic from Android TV
  • How-to guides
    • Gaming
      • How to set up a private Minecraft server with Meshnet
      • How to set up a private Stardew Valley server with Meshnet
      • How to play Quake 3 Arena over Meshnet
      • How to set up a private Team Fortress 2 server with Meshnet
      • How to set up a remote game-streaming server for Moonlight
      • How to set up a Palworld dedicated server
      • How to play Fallout: New Vegas multiplayer over Meshnet
      • How to set up a private Factorio server with Meshnet
    • Remote files and media access
      • How to set up and access shared folders
        • Configure and access shared folders on Windows
        • Configure and access shared folders on macOS
        • Configure and access shared folders on Linux
        • Access shared folders from Android
        • Access shared folders from iPhone/iPad
        • Access shared folders from Android TV
      • How to watch videos over Meshnet using Kodi
      • How to configure and access a Jellyfin media server remotely
      • How to set up a Plex media server and access it remotely
      • How to set up a remote NAS using OpenMediaVault and Meshnet
      • How to set up a remote picture library with LibrePhotos and Meshnet
      • How to use Syncthing for remote continuous file synchronization
      • How to set up a remote Airsonic music server
      • How to set up HTTP File Server for remote file access
      • How to set up a remote audiobook server
      • How to host a remote Kavita e-book server
      • How to set up and remotely access Immich using Meshnet
    • Remote device access
      • How to log in to your PC remotely over Meshnet
        • Connect to a Windows device
        • Connect to a macOS device
        • Connect to a Linux device
      • How to access remote systems over Meshnet using SSH
      • How to access your IP camera over Meshnet
      • How to use Home Assistant remotely over Meshnet
      • How to make secure macOS Time Machine backups from anywhere
      • How to use Ansible over Meshnet
      • How to access files in your NAS from anywhere without compromising its security
      • How to set up a phone as a security camera with remote access
      • How to assign custom host names to Meshnet services using Nginx proxy manager
      • How to use Proxmox VE remotely over Meshnet
      • How to set up a remotely controlled 3D printer
      • How to set up and remotely access a CasaOS server
    • Joint projects
      • How to set up an NGINX web server and remotely access it over Meshnet
      • How to use Nextcloud file syncing with Meshnet
      • How to set up pair programming using tmux
      • How to set up a Visual Studio Code server for remote development over Meshnet
      • How to host a Focalboard server for remote project management
      • How to use Meshnet for multi-screen Node.js development
      • How to use the Multi-user editing plugin in Unreal Engine over Meshnet
      • How to set up a private Mumble voice chat server
      • How to host a private Rocket.Chat server
    • Own VPN server setup
      • How to set up a VPN server through self-hosting or with DigitalOcean
      • How to create a VPN server with Microsoft Azure
      • How to create a VPN server with AWS
      • How to create a VPN server with Google Cloud
      • How to create a VPN server with Linode
      • How to create a VPN server with Hetzner
    • Network protection
      • How to set up your network protection with Pi-hole
      • How to set up your own DNS server
      • How to protect your network with AdGuard Home
      • How to use the self-hosted Whoogle search engine remotely
      • How to set up a VPN router using Meshnet
  • Troubleshooting
    • Common issues on Windows
    • Common issues on Android
    • Common issues on iPhone/iPad
    • Common issues on macOS
    • Common issues on Linux
Powered by GitBook

© 2025 Nord Security. All Rights Reserved.

On this page
  • Introduction
  • What is SSH?
  • Using SSH on Linux, Windows, and macOS
  • Enable SSH access
  • Connect to your remote computer through SSH
  • Configuring SSH keys
  • Generate an SSH key
  • Copy your public SSH key to a remote device
  • (Showcase) SSH connection using Visual Studio Code
  • Install VS Code
  • Install the SSH extension
  • Add a new SSH host device
  • Establish the SSH connection

Was this helpful?

  1. How-to guides
  2. Remote device access

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.

PreviousConnect to a Linux deviceNextHow to access your IP camera over Meshnet

Last updated 8 months ago

Was this helpful?

Introduction

With the advancement of technology, remote system management has become crucial in today's digital landscape. (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 , 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.

What is SSH?

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.

Using SSH on Linux, Windows, and macOS

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 .

Enable SSH access

To make your device accessible via SSH, you need to install and enable the OpenSSH server software.

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 and select System > Optional features.

  2. Click View features.

  3. In the search field, type in OpenSSH, select the OpenSSH Server checkbox, and click Next.

  4. Click Add.

  5. Once the installation is finished, open PowerShell as an administrator by pressing the Windows key + 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. Under Advanced, turn on the Remote login toggle.

  2. Optionally, specify which users can log in.

You can now connect to your Mac via SSH from any remote device over Meshnet.

Connect to your remote computer through SSH

Before attempting to connect, ensure 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

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>

    Example

    ssh ubuntu@100.105.90.201

    or

    ssh ubuntu@secret.meerkat-altai.nord

  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. Open ConnectBot.

  2. Tap the plus (+) button to add a host device.

  3. 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

  4. Tap the plus (+) button in the upper-right corner.

  5. Select the newly added host device to initiate a connection.

  6. 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. Open WebSSH.

  2. To add a new host device, tap the empty area of the main screen or the plus button in the upper-right corner.

  3. 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.

      Example

  4. Tap the check mark button in the upper-right corner.

  5. From the main application screen, tap the newly added device to initiate a connection.

  6. Tap Continue to confirm the host key fingerprint.

You should now be connected to your remote device using SSH.

Configuring SSH keys

Generate an SSH key

To use key-based authentication, you first need to generate a key pair on the device from which you will be making an SSH connection.

  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.

Copy your public SSH key to a remote device

To use SSH keys for authentication, you need to copy the public key of your device to the device you will be accessing. For example, if you are using Windows and want to connect to a Linux server, you need to copy the public SSH key of the Windows device to the Linux machine.

When establishing an SSH connection, the public key is matched with the private key to authorize the connection.

Allow SSH key authentication on Windows

To connect to a Windows device using an SSH key, you must first enable public key authentication. Otherwise, you will be asked to enter the SSH password even after sharing the public key.

On the remote device that you will be accessing, take the following steps:

  1. Open PowerShell as an administrator.

  2. Navigate to the ssh folder by using the cd command:

    cd C:\ProgramData\ssh

  3. Run the following command to create a new administrators_authorized_keys file which will store the public keys of the connecting devices:

    New-Item -ItemType File -Name administrators_authorized_keys

  4. Update the permissions to the newly created file with the following command:

    icacls administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

  5. Run the command below to open the sshd_config file:

    notepad sshd_config

  6. Locate and uncomment the PubkeyAuthentication yes line by removing the hash (#) symbol at the start.

  7. Press Ctrl + S to save changes and exit Notepad.

To exchange the SSH public key, follow these steps on the device from which you want to establish an SSH connection:

  1. Open PowerShell.

  2. Depending on the device that you will be accessing, run the following appropriate commands, where <username> is the username of the remote device's account and <server> is the remote device’s Nord name or Meshnet IP.

    • If you're copying your SSH key to a Linux or a macOS device, use this command:

      type $env:userprofile\.ssh\id_rsa.pub | ssh <username>@<server> "cat >> .ssh/authorized_keys"

      Example

      type $env:userprofile\.ssh\id_rsa.pub | ssh ubuntu@secret.meerkat-altai.nord "cat >> .ssh/authorized_keys"

    • If you're copying your SSH key to a Windows device, use the following three commands:

      $PublicKey = Get-Content "$env:userprofile\.ssh\id_rsa.pub"
      $CopyKey= "echo $PublicKey >> %programdata%\ssh\administrators_authorized_keys"
      ssh <username>@<server> $CopyKey

      Example

      $PublicKey = Get-Content "$env:userprofile\.ssh\id_rsa.pub"
      $CopyKey = "echo $PublicKey >> %programdata%\.ssh\administrators_authorized_keys"
      ssh meshnet@secret.meerkat-andes.nord $CopyKey

  3. If prompted, type in yes and press Enter to confirm the key fingerprint.

  4. Enter the remote device’s account password and press Enter.

To exchange the SSH public key, follow these steps on the device from which you want to establish an SSH connection:

  1. Open Terminal.

  2. Run the following command, where <username> is the username of the remote device's account and <server> is the remote device’s Nord name or Meshnet IP:

    ssh-copy-id <username>@<server>

    Example

    ssh-copy-id ubuntu@secret.meerkat-altai.nord

  3. If prompted, type in yes and press Enter to confirm the key fingerprint.

  4. Enter the remote 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 remote 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.

(Showcase) SSH connection using Visual Studio Code

A tool that is often used by beginners and novices alike for SSH connection is Visual Studio Code (VS Code). At its core, VS Code is an integrated development environment (IDE). However, with the help of a vast marketplace, it can be used as a powerful tool for remote server management.

Install VS Code

Install the SSH extension

Once you have installed VS Code, you need to install an extension that will allow you to establish SSH connections to remote devices.

  1. Launch VS Code.

  2. From the left sidebar, select Extensions.

  3. In the search field, type in Remote - SSH and select the corresponding option.

  4. Click Install.

Add a new SSH host device

Next, create a new entry in your system's SSH configuration file for the remote device you want to access directly from the VS Code app. This saved information enables VS Code to display all configured host devices, allowing you to quickly connect to any of them.

  1. From the left sidebar, select the Remote explorer tab.

  2. Next to SSH, click New remote.

  3. In the text field, type in the command to access the remote device using SSH. Example

  4. Select in which SSH configuration file the connection should be saved.

VS Code should prompt a notification that the host has been added.

Establish the SSH connection

Finally, you can connect to the added host device using the Remote - SSH extension.

  1. In the Remote explorer tab, under SSH, locate your newly added connection.

  2. Click Connect in current window.

  3. Select the operating system of the remote device and, if prompted, click Continue to confirm the device fingerprint.

  4. Enter the password of the remote user account and press Enter.

The first connection may take some time, while the relevant packages are installed. After that, you can control the remote device's CLI and navigate its directories using VS Code.

Note

If the remote device is not visible under the SSH section, click the Refresh button next to Remotes (tunnels/SSH).

Choose the Apple menu > System settings > General, and click Sharing.

If needed, select the Info and turn on the Allow full disk access for remote users option.

Download and install the SSH client from the Google Play Store.

Download and install the application from the Apple App Store.

An 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.

You can download VS Code for Windows, macOS, and Linux from the . Choose the file appropriate for your operating system and install the app.

See the section above for more details.

ConnectBot
WebSSH
SSH key
VS Code downloads page
Connect to your remote computer through SSH
Secure Shell
Meshnet
OpenSSH server
OpenSSH Server feature.
OpenSSH Server feature.
Remote login option
Remote login option
SSH key fingerprint confirmation
Remote device's username and hostname
Terminal of the remote device.
Remote device's details for SSH connection.
SSH fingerprint confirmation.
Terminal of the remote device
SSH keys generated
"PubkeyAuthentication yes" line highlighted in Notepad.
"PubkeyAuthentication yes" line highlighted in Notepad.
SSH key fingerprint confirmation
SSH key fingerprint confirmation
SSH key added
Selecting the "Remote - SSH" extension from the marketplace.
Selecting the "Remote - SSH" extension from the marketplace.
"Install" button highlighted.
"Install" button highlighted.
Arrow pointing to the "New remote" button next to SSH.
Arrow pointing to the "New remote" button next to SSH.
SSH command entered in the provided text field.
SSH command entered in the provided text field.
Arrow pointing to the "Connect in current window" button.
Arrow pointing to the "Connect in current window" button.