43

I'm new to Ubuntu and trying to start sshd but having a lot of problems. I've tried uninstalling and reinstalling ssh by running sudo apt-get remove openssh-client openssh-server and sudo apt-get install openssh-client openssh-server. When I run sudo service ssh restart I get:

stop: Unknown instance:
ssh start/running, process 3638

sudo service sshd start gives me unrecognized service.

When I run ps -A | grep ssh I get nothing. Running ssh localhost gives me a connection refused.

gsamaras
  • 605
  • 3
  • 16
  • 35
dandelion
  • 533
  • 1
  • 4
  • 4
  • Why is this tagged as `sshd`? I am facing a problem with it now, but it does not appear in the question, except the title. – gsamaras Jan 23 '16 at 23:04

2 Answers2

58

Try purging before install:

sudo apt-get purge openssh-server
sudo apt-get install openssh-server
Eric Carvalho
  • 53,609
  • 102
  • 137
  • 162
15

Ubuntu ssh service will start with ssh, not sshd.

Try:

 sudo apt-get remove --purge openssh-server
 sudo apt-get install openssh-server

Then try:

sudo service ssh restart   

To check its status:

sudo service ssh status

Config file can be found at /etc/init/ssh.conf

Detail about remove and purge:

remove - Does NOT remove including configuration files

purge - With Purge command, the configuration files are also deleted.

Wolf G
  • 103
  • 2
Ramesh Chand
  • 7,116
  • 4
  • 30
  • 37