As the title asks, how can I determine it? Does simply having the ability to use ssh on a Linux machine mean openSSH is installed? I tried ssh -V
and that gave me a version number, but does that mean openSSH is installed or is the ssh command coming from another tool?

- 976
- 1
- 11
- 26
-
Do you mean the client, or the daemon? – Dirk Eddelbuettel Nov 02 '17 at 15:41
-
I thought openssh was a suite of tools. – bitscuit Nov 02 '17 at 15:44
-
Possible duplicate of [Check if a program exists from a Bash script](https://stackoverflow.com/q/592620/608639) and [How to check if command exists in a shell script?](https://stackoverflow.com/questions/7522712/how-to-check-if-command-exists-in-a-shell-script) – jww Nov 02 '17 at 19:46
-
yes it should mean version number tho i have no idea if that's server or client – Fuseteam Jun 28 '18 at 00:23
2 Answers
When I do ssh -V
to check the version, I get the following, indicating I do in fact have openssh installed:
$ ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13, OpenSSL 1.0.1f 6 Jan 2014
If you don't see OpenSSH
plus a version number, like I do, then you must not have the openssh-client
installed, and as you insinuated, you must be getting the ssh
binary from some other ssh application.
To see all of your packages installed which have ssh
in them, pipe your dpkg --list
output to grep
using this command:
dpkg --list | grep ssh
...as I have done below. You can see I have openssh-client
, openssh-server
, openssh-sftp-server
, and ssh-add
installed, all of which are part of OpenSSH:
$ dpkg --list | grep ssh
ii libssh-4:amd64 0.6.1-0ubuntu3.3 amd64 tiny C SSH library
ii libssh2-1:amd64 1.4.3-2ubuntu0.1 amd64 SSH2 client-side library
ii openssh-client 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) server, for secure access from remote machines
ii openssh-sftp-server 1:6.6p1-2ubuntu2.13 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
ii python-paramiko 1.10.1-1git1build1 all Make ssh v2 connections with Python (Python 2)
ii ssh-askpass-gnome 1:6.6p1-2ubuntu2.8 amd64 interactive X program to prompt users for a passphrase for ssh-add
ii ssh-import-id 3.21-0ubuntu1 all securely retrieve an SSH public key and install it locally
ii sshfs 2.5-1ubuntu1 amd64 filesystem client based on SSH File Transfer Protocol
ii sshpass 1.05-1 amd64 Non-interactive ssh password authentication
Here is a screenshot so you can see the red-colored ssh
findings:
Also be aware that OpenSSH consists of a whole bunch of ssh-related binary utilities, NOT just the ssh
command. See: https://en.wikipedia.org/wiki/OpenSSH. Some of them are as follows:
The OpenSSH suite includes the following command-line utilities and daemons:
scp
, a replacement forrcp
sftp
, a replacement forftp
to copy files between computersssh
, a replacement forrlogin
,rsh
andtelnet
to allow shell access to a remote machine.ssh-add
andssh-agent
, utilities to ease authentication by holding keys ready and avoid the need to enter passphrases every time they are usedssh-keygen
, a tool to inspect and generate the RSA, DSA and Elliptic Curve keys that are used for user and host authenticationssh-keyscan
, which scans a list of hosts and collects their public keyssshd
, the SSH server daemon
References:

- 36,492
- 15
- 194
- 265
"Does simply having the ability to use ssh on a Linux machine mean openSSH is installed?"
Answer: No. If you want to connect to a linux machine or server through SSH, the server you want to connect to must have the openssh-server package installed and configured. The computer you're using to connect to the server does not have to have openssh-server installed. It only needs the openssh client.
You can use Debian's package management system to confirm whether the openssh-server is installed:
sudo apt version openssh-server
If you see nothing printed out on the console, then you do not have it installed.
You can also use the dpkg:
sudo dpkg -l openssh-server

- 36,492
- 15
- 194
- 265

- 929
- 8
- 15
-
6"sudo apt version openssh-server" gives me "E: Invalid operation version" when the second option "sudo dpkg -l openssh-server" works. – Patapoom Jan 17 '19 at 12:37
-
Mine shows this result: Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= un openssh-server
(no description available) Does it mean I don't have it installed?