3

I use Ubuntu server 16.04.1 LTS (Kernel 4.4.0-38-generic x86_64). And Install openssh-server(1:7.2p2-4ubuntu2.1). At first, I use below.

sudo systemctl enable ssh.service

But sshd doesn't start in boot process. So, I check this Questions -> (SSH Daemon does not autostart) And try this article -> (http://blog.roberthallam.org/2010/06/sshd-not-running-at-startup) However, sshd doesn't start. (sudo service ssh status is dead.) Of course, I check symbolic link of /etc/rc*.d/S**ssh is created.

Then I added below to /etc/rc.local.

/etc/init.d/ssh start

Finally, sshd does start on boot, but I wonder why normally process doesn't work. It might be because using usb wireless adapter, but I cannot be sure that. Please tell me what do you think.

  • I have no direct experience with this, but reading around it seems likely that the "right" approach is to tell sshd to start on network-online.target instead of network.target - see Linux tip: Force systemd networkd to wait for DHCP - but note that you are probably using NetworkManager not networkd - so the enable command would be systemctl enable NetworkManager-wait-online.service Running Services After the Network is up – steeldriver Sep 27 '16 at 13:09
  • Thanks. I didn't understand well about "ssh daemon needs specific IP." I didn't set ListenAddress of sshd_config . So I thought sshd doesn't need specific IP to start service. I thought device initialization is only needed by ssh daemon. – MAD_PEPPER Sep 28 '16 at 13:06
  • I tried network-online.target approach, but failed to start sshd. And I don't use NetworkManager, but networking daemon. This may be because of version of systemd. systemd message is Dependency failed for Wait for Network to be Configured. systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency' – MAD_PEPPER Sep 28 '16 at 15:39
  • I re-install "ubuntu server", and I checked option of "open-ssh" install in dialogue. This works well, and sshd is start automatically. After all, I don't understand cause of this problem. – MAD_PEPPER Oct 01 '16 at 21:13

1 Answers1

0

Well make sure openssh-server is installed. If installed already try reinstalling as follows :

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

For Ubuntu 16.04 LTS , there isn't any issue with 4.4 kernel and Linux kernel 4.6 is also compatible as well. If you still have the problem then I recommend you to upgrade your kernel or recompile your kernel.

edwinksl
  • 23,789
SAGAR Nair
  • 1,385
  • I didn't write in question, but I already re-installed openssh-server. But nothing changed. No one else seems to have same problem, I think this is my environmental problem. – MAD_PEPPER Sep 28 '16 at 11:23
  • Linux image 4.6 don't seems to provide with apt . I think manually upgrade of linux kernel isn't recommended. I'm unwilling to. – MAD_PEPPER Sep 28 '16 at 12:19