0

I have ssh and openconnect installed but when I proceed to start or stop the ssh service, I get the following error:

Failed to start ssh.service: Unit ssh.service not found.

Also, when I try sudo apt-get install ssh I get the following:

sudo apt-get install ssh
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ncurses-term openssh-server openssh-sftp-server ssh-import-id
Suggested packages:
  ssh-askpass rssh molly-guard monkeysphere
The following NEW packages will be installed:
  ncurses-term openssh-server openssh-sftp-server ssh ssh-import-id
0 upgraded, 5 newly installed, 0 to remove and 193 not upgraded.
Need to get 640 kB of archives.
After this operation, 5.237 kB of additional disk space will be used.
Do you want to continue? [Y/n]

Which I find confusing. If I do which ssh, I get:

/usr/bin/ssh

How can the binary be there if apt-get thinks the package is not installed?

Also, when calling ssh <valid-IP-address>, I get the following error:

ssh: connect to host port 22: No route to host

But if I use openconnect and connect to a VPN, ssh work without problems.

What am I missing? I'm running Ubuntu 16.04.

1

The ssh binary, the SSH client, is provided by the openssh-client package, which is installed on your system.

The ssh service runs the SSH server, provided by the openssh-server package, which isn’t installed on your system.

The ssh package is a meta-package which installs both the client and the server.

  • Just installed that ssh meta package in my buster just for trying it out. Is it recent? +1 – Rui F Ribeiro May 22 at 7:28
  • 1
    It used to be the main binary package; it became a transitional package in 2004, and its description was changed in 2007 to identify it as a meta-package. – Stephen Kitt May 22 at 7:33
  • Thanks! I have been using openssh-client and openssh-server directly for ages now. – Rui F Ribeiro May 22 at 7:43
  • Thanks for your answer! What would explain me not being able to connect with ssh without the vpn connection, then..? – Kirjain May 22 at 7:50
  • 1
    @Kirjain that’s more likely to be network-related rather than contingent on the availability of the SSH service. I would guess you’re trying to connect to a host which isn’t reachable directly, but is reachable over your VPN. – Stephen Kitt May 22 at 7:56
0

You SSH package/daemon/service is not installed.

For installing the SSH service on Ubuntu, you run:

sudo apt-get install openssh-server

see Packages - openssh-server - xenial

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.