Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Setting up openssh-server (1:5.3p1-3ubuntu7) ... Creating SSH2 RSA key; this may take some time ... Creating SSH2 DSA key; this may take some time ... start: Job failed to start

can't inicialize ssh, already tried reinstall.

netstat -tlnp shows that no service is running on tcp port 22

share|improve this question
Going to the basics... are you running as root or using sudo when you try to start it? Did you edit the configuration file and now there are possible errors in the configuration? What command did you run to get the output you posted above? Have you checked your log files? – Safado Sep 14 '11 at 21:55

You've not provided much information but some common reasons why a service fails to start are:

  • If there is something already listening on port 22; Do a netstat -tlnp to see if there is something listening on port 22.
  • If there is insufficient memory. Do a free -m to ensure that there is sufficient memory free.

You can possibly try starting it manually to see if it works or shows more error messages. Check your log files.

Run /etc/init.d/sshd restart to see.

share|improve this answer
running it manually says the same thing more: you can use upstart to start ssh, start ssh, but gives the same error, with service it give the same error too – Frielspak Jul 17 '11 at 23:15
What does the netstat and free show? – sybreon Jul 21 '11 at 2:00

Not sure that my solution is right. But if you just want to start your SSH server and then solve your problem later, here is my fast solution:

start-stop-daemon --start --pidfile /var/run/ --exec /usr/sbin/sshd -- -p 22

if then you will see error:

Missing privilege separation directory: /var/run/sshd

then just create that missing directory, and try above start-stop-daemon command again:

mkdir /var/run/sshd
chmod 0755 /var/run/sshd

that helped me to start my sshd daemon.

share|improve this answer

If your machine is a VPS which runs in an OpenVZ container, then try to comment out the "oom never" line in the /etc/init/ssh.conf file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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