Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 initialize ssh, already tried reinstall.

SSH server is started manually via /etc/init.d/ssh start

netstat -nlp shows that no services are running at tcp port 22

share|improve this question
Could you clarify in your question if you have tried starting it manually, ie sudo /etc/init.d/ssh start, and if so, did it give a different error than when you installed? Also, maybe you would want to install nmap and run nmap to see if there is already a instance of ssh running and put the result in your question. –  Azendale Jul 17 '11 at 20:21
i tried to run it manually, and got the same thing –  Frielspak Jul 17 '11 at 23:14
Try to start once again the ssh daemon manually and then open /var/log/auth and check at the bottom of the file what the logs show... –  Pavlos G. Aug 22 '11 at 10:59
add comment

1 Answer

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/sshd.pid --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
This only fixes it for the current session. After a reboot that directory will be gone. –  Malfist Nov 18 '13 at 4:28
add comment

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.