Ubuntu 14.04 prompts initctl: unknown task: ssh after installing openssh-server

The problem manifests:
root@ubuntu:/home/ubuntu# apt-get install openssh-server
Reading package list... Done
analyzing dependency tree of packages       
Reading status info... Done       
suggested software to install Packages:
  rssh molly-guard monkeysphere
The following [new] packages will be installed:
  openssh-server
0 packages upgraded, 1 package newly installed, 0 packages to uninstall, 483 packages not upgraded .
A 0 B/324 kB package needs to be downloaded.
Decompression consumes 1,015 kB of additional space.
Preparing packages...
Selecting previously unselected package openssh-server.
(Reading database... The system currently has a total of 169552 files and directories installed.)
Preparing to unpack .../openssh-server_1%3a6. 6p1-2ubuntu2_i386.deb ...
Unpacking openssh-server (1:6.6p1-2ubuntu2) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) .. .
Processing triggers for man-db (2.6.7.1-1) ...
setting up openssh-server (1:6.6p1-2ubuntu2) ...
initctl: unknown task: ssh

solution:
root@ubuntu:/usr/sbin# sudo /usr/sbin/sshd 
Missing privilege separation directory: /var/run/sshd
root@ubuntu:/usr/sbin# mkdir /var/run/sshd
root@ubuntu:/usr/sbin# sudo /usr/sbin/sshd 
root@ubuntu:/usr/sbin# netstat -nlt
activate internet connection (server only)
Proto Recv-Q Send-Q Local Address Foreign Address State      
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN     
tcp 0 0 0.0. 0.0:22 0.0.0.0:* LISTEN     
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN     
tcp6 0 0 :::22 :::* LISTEN     
tcp6 0 0 ::1:631 :::* LISTEN     

start port 22 indicates that the ssh service is successfully started, you can use ssh localhost to test.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326222754&siteId=291194637