SSH to a Headless Server in Windows 11 Terminal

This guide explains how to connect to a headless server remotely using the built-in OpenSSH client within Windows 11 Terminal. Windows 11 includes native OpenSSH support, eliminating the need for third-party software like PuTTY. By using standard command-line tools, you can establish a secure, encrypted shell session to manage Linux or Windows servers directly from your desktop.

1. Verify OpenSSH Client on Windows 11

The OpenSSH Client is installed by default on Windows 11. To verify it is ready:

  1. Right-click the Start button and select Terminal (or search for “Terminal” in the Start menu).
  2. Type ssh and press Enter.
  3. If installed, the terminal displays the OpenSSH usage syntax and available options.

If the command is not recognized, install it via Windows Settings: - Go to Settings > System > Optional features. - Search for OpenSSH Client and click Install.


2. Gather Server Connection Details

Before initiating the connection, ensure you have the following information for your headless server:


3. Connect Using Password Authentication

To establish a standard password-authenticated session:

  1. Open Windows Terminal.
  2. Run the SSH command using the following syntax:
ssh username@server_ip_address

Example:

ssh ubuntu@192.168.1.150
  1. If the server uses a non-standard SSH port, specify it with the -p flag:
ssh -p 2222 ubuntu@192.168.1.150
  1. Host Authenticity Prompt: If this is your first time connecting, you will see a fingerprint verification prompt:

    Are you sure you want to continue connecting (yes/no/[fingerprint])?

    Type yes and press Enter. This saves the server’s fingerprint to your local known_hosts file.

  2. Enter the user’s password when prompted (the cursor will not move while typing) and press Enter.

Once authenticated, your terminal prompt changes to reflect the remote server’s environment.


SSH keys provide a more secure, passwordless authentication method.

Step 1: Generate an SSH Key Pair (if you don’t have one)

In Windows Terminal, run:

ssh-keygen -t ed25519

Press Enter to accept the default file location (C:\Users\<YourUser>\.ssh\id_ed25519), and optionally set a passphrase.

Step 2: Copy the Public Key to the Headless Server

View and copy your public key:

Get-Content ~\.ssh\id_ed25519.pub

Append this public key string to the ~/.ssh/authorized_keys file on your remote server.

Step 3: Connect with Key Authentication

Once the key is added, connect normally:

ssh -i ~/.ssh/id_ed25519 username@server_ip_address

5. Create an SSH Config File for Fast Access

To avoid typing the full IP and username each time, configure an SSH alias:

  1. Open or create the config file in Windows Terminal:

    notepad ~\.ssh\config
  2. Add the host configuration block:

    Host myserver
        HostName 192.168.1.150
        User ubuntu
        Port 22
        IdentityFile ~/.ssh/id_ed25519
  3. Save and close the file.

  4. Connect instantly using only the alias:

    ssh myserver

6. Terminate the Session

When you are finished administering your headless server, type:

exit

Press Enter to close the remote session and return to your local Windows Terminal prompt.