How to connect to a Linux server using SSH on Windows 11

You can leave PuTTY behind and connect to your Linux servers directly from Command Prompt or PowerShell using a feature already available on Windows 11.

Windows 11 SSH with key connection
Windows 11 SSH with key connection / Image: Mauro Huculak & AI
  • Windows 11 includes an optional OpenSSH Client that lets you connect to Linux servers directly from Command Prompt, PowerShell, or Windows Terminal.
  • You can authenticate using a Linux account password or an existing SSH private key, including keys converted from PuTTY’s PPK format.
  • You can fix private key permission errors using PowerShell and configure multiple server connections through an SSH config file.

You don’t need PuTTY to connect to a Linux server from Windows 11. The operating system includes a built-in OpenSSH client that lets you establish secure connections directly from Command Prompt or PowerShell, including connections that use SSH keys for authentication.

For years, I’ve used PuTTY to connect to my Linux servers from Windows. It worked reliably, and I was comfortable managing my connections using PuTTY’s .ppk private keys. Although I knew Windows included its own SSH client, I could never get key-based authentication to work, so I never bothered looking into it. PuTTY did everything I needed.

However, I recently decided to simplify my workflow and learn how to connect to my servers using Windows’ built-in SSH client. Once I learned how to use my existing keys, the process was much more straightforward than I expected.

In this guide, I’ll walk you through the steps to connect to a Linux server using SSH on Windows 11, including password authentication, SSH key authentication, converting PuTTY private keys, fixing key permissions, and creating an SSH configuration file to simplify future connections.

Connect to a Linux server using SSH on Windows 11

To connect to a Linux server from Windows 11, you need the OpenSSH client, the server’s IP address or hostname, and a valid user account. You can authenticate using a password or an SSH private key.

1. Check if the OpenSSH client is installed

Windows 11 includes an optional OpenSSH Client feature that lets you establish secure connections to remote computers and servers.

Before proceeding, check whether the client is already installed with these steps:

  1. Open Start.

  2. Search for Command Prompt, PowerShell, or Terminal and click the top result to open the console.

  3. Type the following command to check the SSH version (it’s -V, not -v) and press Enter.

    ssh -V

    Check SSH  version

If the client is installed, the command will display the OpenSSH version. If Windows doesn’t recognize the command, install the OpenSSH Client feature.

Get the Pureinfotech newsletter

Expert Windows guides, practical tips, and the latest updates that make your PC easier to use, delivered to your inbox

Install OpenSSH Client

To install it through the Settings app, follow these steps:

  1. Open Settings.

  2. Click on System.

  3. Click the Optional features page.

  4. Click the View features button next to “Add an optional feature.”

  5. Click on “See available features.”

    Optional features install OpenSSH

  6. Search for OpenSSH Client.

  7. Select the OpenSSH Client feature.

  8. Click Add to complete the installation.

After completing the installation, you can use the ssh command from Command Prompt or PowerShell.

2. Connect to a Linux server using a password

The simplest way to connect to a Linux server is to use your username and the server’s IP address using these steps:

  1. Open Start.

  2. Search for Command Prompt, PowerShell, or Terminal and click the top result to open the console.

  3. Type the following command to establish an SSH connection and press Enter:

    ssh username@server-ip

    In the command, replace username with your Linux account name and server-ip with the IP address of your server. For example: ssh [email protected].

The first time you connect to a server, SSH will display a message asking whether you trust the server’s host key.

Before accepting, verify the displayed fingerprint against the fingerprint provided by your server administrator or hosting provider.

If the fingerprint matches, type yes and press Enter.

The system will save the server’s host key in this C:\Users\YourName\.ssh\known_hosts path.

This prevents SSH from asking you to verify the same server again during future connections, unless its host key changes.

The last thing you have to do is enter your Linux account password and press Enter.

Important: The terminal won’t display anything as you type your password. This is normal behavior. Type the password and press “Enter” to authenticate.

Once authentication succeeds, you’ll have access to the Linux server’s command-line interface.

3. Connect to a Linux server using an SSH key

Password authentication works, but using an SSH key is generally more convenient and secure. If this is a private server online, it likely uses an SSH key.

SSH key authentication uses a pair of cryptographic keys. The private key stays on your local computer, while the corresponding public key must be installed on the Linux server.

If your public key is already configured on the server, you can connect using these steps:

  1. Open Start.

  2. Search for Command Prompt, PowerShell, or Terminal and click the top result to open the console.

  3. Type the following command to establish an SSH connection and press Enter:

    ssh -i C:\Users\YourName\.ssh\mykey username@server-ip

    Windows 11 SSH connect with key

    In the command, replace the path with the path to your SSH key for the server, username with your Linux account name, and server-ip with the IP address of your server. Also, -i specifies the identity file, which is your private SSH key. For example: ssh -i C:\Users\Mauro\.ssh\mykey [email protected].

If your private key has a passphrase, SSH will ask you to enter it before establishing the connection.

If everything is configured correctly, Windows 11 will authenticate using your private key and connect to the Linux server without asking for your account password.

Quick note: Your private key must remain on your computer. Never upload or share it with your server. Only the matching public key belongs in the server’s ~/.ssh/authorized_keys file.

Connect using a non-standard SSH port

If your server uses a different SSH port instead of the default port 22, you can specify it using the -p parameter.

For example, to connect using port 2222, run this command:

ssh -p 2222 -i C:\Users\YourName\.ssh\mykey username@server-ip

4. Convert a PuTTY private key to OpenSSH format

If you’ve been using PuTTY to connect to Linux servers, chances are your private key uses the .ppk format.

Windows OpenSSH doesn’t support PuTTY’s .ppk format directly. However, you don’t need to generate a new key pair or replace your existing server configuration. You can convert your existing private key to the OpenSSH format.

You can complete this process using PuTTYgen, the utility included with PuTTY.

To convert a PuTTY private key, follow these steps:

  1. Open PuTTYgen.

  2. Click the Load button.

  3. Browse to the location of your existing .ppk private key.

  4. Select the existing PuTTY key file.

  5. Click the Open button.

  6. Confirm the key’s passphrase if prompted to unlock it.

  7. Open the Conversions menu.

  8. Select the Export OpenSSH key option.

    Putty key to OpenSSH

  9. Choose a location inside your Windows 11 user profile’s .ssh folder.

  10. Save the key using a name such as mykey without adding the .ppk extension.

After completing the steps, you can now use this converted private key with Windows OpenSSH.

Quick note: You don’t need to convert the public key or replace the public key already installed on your Linux server. The converted private key represents the same key pair.

If you ever need to retrieve the public key from your converted private key, you can use the ssh-keygen -y -f C:\Users\YourName\.ssh\mykey command.

The command displays the corresponding public key, which you can copy when needed.

5. Fix SSH private key permissions on Windows 11

Sometimes, SSH may refuse to use a private key because its file permissions allow other Windows accounts to access it.

In this situation, you may encounter an error similar to the following: WARNING: UNPROTECTED PRIVATE KEY FILE! Permissions for ‘mykey’ are too open.

To resolve this issue, restrict access to the private key so only your user account can read it.

You can fix the permissions using PowerShell with these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to remove inherited permissions from the private key and press Enter:

    icacls C:\Users\YourName\.ssh\mykey /inheritance:r
  4. Type this command to grant your Windows user account read access and press Enter:

    icacls C:\Users\YourName\.ssh\mykey /grant:r "$($env:USERNAME):(R)"

After completing these steps, try connecting to your Linux server one more time.

6. Create an SSH configuration file to simplify connections

If you frequently connect to the same Linux server, you don’t need to type the entire SSH command every time.

Windows OpenSSH supports a configuration file that lets you save your server’s hostname, username, port, and private key location.

To create the configuration file, follow these steps:

  1. Open File Explorer.

  2. Open your Windows user profile’s .ssh folder. Its location is C:\Users\YourName\.ssh.

  3. Right-click an empty area, select New, and choose Text Document.

  4. Confirm the file config and remove the .txt extension.

  5. Open the file using Notepad.

  6. Copy and paste the following configuration into the text file:

    Host myserver
        HostName server-ip
        User username
        IdentityFile C:\Users\YourName\.ssh\mykey
        Port 22
  7. Replace the example information with your server’s IP address, Linux username, private key location, and SSH port.

  8. Save the file.

    Quick tips: Make sure the file is named config, not config.txt. You can enable file extensions in File Explorer by opening View > Show > File name extensions.
  9. Open Start.

  10. Search for Command Prompt, PowerShell, or Terminal and click the top result to open the console.

  11. Type the following command to establish an SSH connection and press Enter:

    ssh myserver

Once complete the steps, you can connect to your server by opening Command Prompt or PowerShell and running the command from step 11.

The operating system will automatically use the connection details saved in the configuration file, including your private key.

You can also create multiple entries in the same configuration file if you connect to several Linux servers. For example:

Host myserver
    HostName 192.168.1.100
    User mauro
    IdentityFile C:\Users\YourName\.ssh\mykey
    Port 22

Host webserver
    HostName 192.168.1.101
    User root
    IdentityFile C:\Users\YourName\.ssh\webserver-key
    Port 2222

You can then connect to either server using its corresponding alias. For example:

ssh myserver
ssh webserver

Common SSH connection errors on Windows 11

Although connecting to a Linux server using Windows OpenSSH is straightforward, you may encounter a few authentication or connection errors.

Here are some common problems and how to resolve them.

Permission denied (publickey)

This error indicates that the server rejected your key-based authentication attempt.

Check that you’re using the correct Linux username, that you’re pointing to the correct private key, and that its matching public key is installed in the account’s ~/.ssh/authorized_keys file on the server.

Load key: invalid format

This error usually means you’re trying to use an unsupported private key format.

If you’re migrating from PuTTY, make sure you’ve converted the .ppk file to OpenSSH format and that your SSH command points to the converted private key.

Connection timed out

This error indicates that the operating system couldn’t establish a connection to the server.

Check the server’s IP address, SSH port, network connection, and firewall configuration. Also, make sure the SSH service is running on the Linux server.

Host key verification failed

This error can occur if the server’s host key changes, for example, after reinstalling Linux or rebuilding the server.

If you’ve confirmed that the server was legitimately reinstalled or its host key was intentionally changed, you can remove the old entry from your Windows known_hosts file using this command.

ssh-keygen -R server-ip

Replace server-ip with the server’s IP address.

The next time you connect, SSH will ask you to verify the new host key. Always verify its fingerprint before accepting it.

Wrapping things up

I’ve used PuTTY for years because it was familiar and reliable, and I never had a strong reason to change. However, after learning how to use Windows’ built-in OpenSSH client with my existing private keys, I found that I could simplify my workflow without relying on another application.

The biggest advantage is that I can now connect to my Linux servers directly from Command Prompt or PowerShell, use the same terminal for my Windows and Linux administration tasks, and save connection details in a configuration file.

If you’re still using PuTTY to manage your Linux servers, I wouldn’t necessarily say you need to stop using it. However, if you want to simplify your setup, Windows 11 already includes everything you need to connect via SSH without installing another client.

Do you use PuTTY or Windows’ built-in SSH client to connect to your Linux servers? Let me know in the comments.

Thank you for your feedback!
About the author

Mauro Huculak is a Windows How-To Expert and founder of Pureinfotech in 2010. With over 23 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS.

Certifications: Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+.

Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central.

You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at [email protected].

Comments

Join In