How do I check if openSSH is installed on Ubuntu

bitscuit picture bitscuit · Nov 2, 2017 · Viewed 16.6k times · Source

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?

Answer

Gabriel Staples picture Gabriel Staples · Oct 30, 2019

When I do ssh -V 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: enter image description here

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 for rcp
  • sftp, a replacement for ftp to copy files between computers
  • ssh, a replacement for rlogin, rsh and telnet to allow shell access to a remote machine.
  • ssh-add and ssh-agent, utilities to ease authentication by holding keys ready and avoid the need to enter passphrases every time they are used
  • ssh-keygen, a tool to inspect and generate the RSA, DSA and Elliptic Curve keys that are used for user and host authentication
  • ssh-keyscan, which scans a list of hosts and collects their public keys
  • sshd, the SSH server daemon

References:

  1. https://en.wikipedia.org/wiki/OpenSSH
  2. https://askubuntu.com/questions/423355/how-do-i-check-if-a-package-is-installed-on-my-server