Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check if openSSH is installed on Ubuntu

Tags:

linux

openssh

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?

like image 834
bitscuit Avatar asked Nov 02 '17 15:11

bitscuit


People also ask

How do I know if OpenSSH is running?

To check if SSH is enabled on your system, open a command prompt and end the command ssh . If it provides you with help for using SSH, it is already enabled! You should be able to follow the Linux instructions using the ssh-keygen command from the command prompt.

How do I know if I have SSH?

For ssh client : ssh google.com; if it says command not found, you havent got it installed. For ssh server : ssh localhost; if it doesn't do anything you haven't got ssh server. but if he had changed the port, then he would know he 's running ssh no :p? That's assuming he's the one who set the server up.

How do I find OpenSSH?

You can also find the OpenSSH server version running on the remote servers. This can be find by connecting remote server over SSH protocol in verbose. The connection log shows the SSH server version on local system as well as OpenSSH version running on remote machine.


1 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: 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
like image 83
Gabriel Staples Avatar answered Sep 21 '22 03:09

Gabriel Staples