16

I am setting up a LAMP server and want to use SSH. I saw a command for sudo apt-get install ssh and wondered if it was the same thing as openssh?

If I was to now do a apt-get install openssh would I have two different versions of ssh on my machine?

25

Ok... Simple: Let's ask the package manager aptitude search ssh. You will get a rather large output, but I'll pick a few for you:

i A openssh-client                  - secure shell (SSH) client, for secure acce
p   openssh-server                  - secure shell (SSH) server, for secure acce
p   ssh                             - secure shell client and server (metapackag
v   ssh-client                      -                          
v   ssh-server                      -                                          

That is my desktop and it doesn't have a ssh server. It does have a client. See the first letter? Here you see three different ones: i, p and v. They stand for installed, purged and virtual. Installed is obvious, the program is there. purged means not installed, if you remove a program completely, it is called purging and that is indistinguishable from a program that has never been installed. Finally, there is virtual. Those are not real packages but point to one or more packages to be installed.

As you can see in the description ssh is a normal package which will install the client and the server. Let's ask the package manager what exactly it means: aptitude show ssh, which will give you:

Package: ssh                             
State: not installed
Version: 1:6.6p1-2ubuntu2.8
Priority: optional
Section: net
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: all
Uncompressed Size: 29,7 k
Depends: openssh-client (>= 1:6.6p1-2ubuntu2.8), openssh-server (>= 1:6.6p1-2ubuntu2.8)
Description: secure shell client and server (metapackage)
 This metapackage is a convenient way to install both the OpenSSH client and the OpenSSH server. It provides nothing in and of itself, so you
 may remove it if nothing depends on it.
Homepage: http://www.openssh.org/

The description is pretty straightforward, but you can gather more information from it than just the description. There is a line starting with Depends. That means, "in order to install this package the following packages must also be installed". Now look at that: it installs both openssh-client and openssh-server.

So, what is the difference? aptitude install openssh-server will install only, and only openssh-server. aptitude install ssh will both install openssh-server and openssh-client, but unless you have a very strange configuration, you almost certainly already have openssh-client.

So practically? There is no difference... but you got to learn something about packages today.

  • Thanks for the excellent answer jawtheshark. I see when I run "aptitude" that it is not currently installed...must not be a default program that is installed with Ubuntu? – jb61264 Aug 20 '16 at 21:17
  • 1
    It's not, indeed. Many instructions tell you to use apt-get which is totally fine. I prefer aptitude as it integrates a bunch of functionality from the different apt-* programs. For example, the search command needs to be done with apt-cache instead of apt-get. The new kid on the block is apt, which is included by default in 16.04LTS – jawtheshark Aug 20 '16 at 21:26
  • 1
    Historically (from memory, others can correct me), it's dpkg, apt-get (and many other tools starting with apt-), aptitude and now apt. In order, dpkg being the oldest, and aptthe newest. – jawtheshark Aug 20 '16 at 21:29
  • 1
    @jb61264 You should probably accept this answer as it completely answers your question. I doubt you can get anything better than this. :) – Shomz Aug 21 '16 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.