Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Connect to an SSH Server on Windows, macOS, or Linux

Use OpenSSH or PuTTY to sign in to a server you manage, verify its host key, and troubleshoot common connection errors.

Table of Contents

To connect to an SSH server you’re authorized to use, open a terminal and run ssh username@server.example.com. Replace the placeholders with the remote account and server address. Add -p before the destination if the administrator gave you a port other than 22.

Connect with the OpenSSH client

  • Windows: Open Windows Terminal or PowerShell and run ssh -V. If the command is missing, search Settings for Optional features and install OpenSSH Client. See Microsoft’s SSH client guide.
  • macOS: Open Terminal from Spotlight or Applications > Utilities.
    How to Connect to an SSH Server from Windows, macOS, or Linux Picture 4
    How to Connect to an SSH Server from Windows, macOS, or Linux Picture 5
  • Linux: Open a terminal. If ssh is missing, install the OpenSSH client using your distribution’s package manager.
    How to Connect to an SSH Server from Windows, macOS, or Linux Picture 8
ssh username@server.example.com
ssh -p 2222 username@server.example.com
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 6
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 7
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 9

Verify the host key and sign in

On the first connection, compare the fingerprint displayed by the client with the fingerprint your administrator provides through a trusted channel. Accept it only if it matches. If a previously known key changes, stop and confirm the reason with the administrator. After verification, enter your account password if the server allows it, or use the private key that matches the public key registered for your account. Never share the private key. To select a particular key file, use ssh -i path/to/private-key username@server.example.com.

How to Connect to an SSH Server from Windows, macOS, or Linux Picture 10
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 11

Use PuTTY on Windows if you prefer a graphical client

Enter the hostname and port, select SSH, and click Open. Check the fingerprint in the first-connection dialog before accepting. Enter the remote username and sign in using the method your administrator provided.

How to Connect to an SSH Server from Windows, macOS, or Linux Picture 1
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 2
How to Connect to an SSH Server from Windows, macOS, or Linux Picture 3

Troubleshoot a failed connection

  • Timeout: Verify the address and whether your network requires a VPN or other approved connection.
  • Connection refused: Confirm the port with the administrator and check whether the SSH service is running if you manage the server.
  • Permission denied: Check the remote account name and whether it accepts your selected key or password method.

Type exit when you are done to close the remote session.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.