The simplest way to check for SSH is by opening your terminal or command prompt and running the command ssh -V. This attempts to display the version number of the SSH client. If you receive a version number (like OpenSSH_9.5p1), the client is installed. If you receive a "command not found" error, it is not. This basic check only confirms the client is on your machine; determining if an SSH server is running or properly configured requires a more detailed investigation depending on your operating system.
Understanding the difference: SSH client vs. server
Before you start, it's crucial to understand the two parts of SSH:
- SSH Client: This is the program you use on your local computer to initiate a connection to a remote machine. All you need to do is have the client installed. Linux and macOS have it pre-installed, while recent versions of Windows also include it.
- SSH Server (or Daemon): This is a service that runs on a remote machine to listen for and accept incoming SSH connections. You only need an SSH server running on a machine if you intend for other people to connect into it.
The checks below will help you determine the status of both on your machine.
How to check for SSH on Windows
In recent versions of Windows 10 and 11, OpenSSH is included as an optional feature, but you may need to explicitly enable it.
Check for the SSH client
- Open PowerShell by searching for it in the Start menu.
- Type the command
ssh -Vand press Enter. - Result: If the client is installed, you will see the OpenSSH version number. If it's not installed, you will receive an error like
"ssh : The term 'ssh' is not recognized...".
Enable the SSH client (if it's missing)
- Open Settings, go to Apps, and then click on Optional features.
- Select Add a feature.
- Find and install the OpenSSH Client.
Check for the SSH server
- Open an elevated PowerShell session by right-clicking the Start menu and selecting Terminal (Admin) or Windows PowerShell (Admin).
- Use the command
Get-Service sshd. - Result: Look for the
Statuscolumn. If it saysRunning, the SSH server is active. If it is stopped, you can start it by runningStart-Service sshd.
How to check for SSH on Linux
The SSH client is almost always pre-installed on Linux distributions, but the server component is often an optional package.
Check for the SSH client
- Open your terminal.
- Type the command
ssh -Vand press Enter. - Result: You will see the version number of the OpenSSH client.
Check for the SSH server
The method for checking the server varies based on the Linux distribution's init system (most modern ones use systemd).
Method 1: Using systemctl (for modern Linux, e.g., Ubuntu, Debian, Fedora)
- Open your terminal.
- Run
sudo systemctl status sshdorsudo systemctl status ssh. - Result: Look for the line that says
Active. If it showsactive (running), the SSH server is enabled and running.
Method 2: Testing connectivity
- Run the command
ssh localhost. - Result: If a connection is established and you are prompted for a password or key, the server is running on the default port. If it fails, the server is likely not active.
How to check for SSH on macOS
Both the SSH client and server are native components of macOS and are generally included by default.
Check for the SSH client
- Open your Terminal app (found in
/Applications/Utilities). - Type the command
ssh -Vand press Enter. - Result: The version of the SSH client will be displayed.
Check for and enable the SSH server
- Go to System Settings (or System Preferences on older versions).
- Click on General and then Sharing.
- Look for the Remote Login option. If the toggle is switched on, the SSH server is active and running.
- You can also check which users have access and see the exact SSH command needed to log in remotely.