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:
- Right-click the Start button and select Terminal (or search for “Terminal” in the Start menu).
- Type
sshand press Enter. - 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:
- Server IP Address or Hostname: e.g.,
192.168.1.150orserver.local - Username: The user account on the remote machine
(e.g.,
ubuntu,root, oradmin) - Port Number: Default is
22(unless custom-configured on the server) - Authentication Credentials: A user password or an SSH private key
3. Connect Using Password Authentication
To establish a standard password-authenticated session:
- Open Windows Terminal.
- Run the SSH command using the following syntax:
ssh username@server_ip_addressExample:
ssh ubuntu@192.168.1.150- If the server uses a non-standard SSH port, specify it with the
-pflag:
ssh -p 2222 ubuntu@192.168.1.150Host 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
yesand press Enter. This saves the server’s fingerprint to your localknown_hostsfile.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.
4. Connect Using SSH Key Authentication (Recommended)
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 ed25519Press 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.pubAppend 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_address5. Create an SSH Config File for Fast Access
To avoid typing the full IP and username each time, configure an SSH alias:
Open or create the config file in Windows Terminal:
notepad ~\.ssh\configAdd the host configuration block:
Host myserver HostName 192.168.1.150 User ubuntu Port 22 IdentityFile ~/.ssh/id_ed25519Save and close the file.
Connect instantly using only the alias:
ssh myserver
6. Terminate the Session
When you are finished administering your headless server, type:
exitPress Enter to close the remote session and return to your local Windows Terminal prompt.