You are not logged in.

#1 2018-11-15 16:08:43

tomz17
Member
Registered: 2018-11-15
Posts: 2

(SOLVED) Slow OpenSSH Daemon startup (3+ minutes!)

Anyone else observing the OpenSSH daemon starting really slowly after being called by systemd?  This only started happening within the past month or two, so it may be tied to a recent update.

i.e.  On last boot it took 3 minutes from the time systemd launched the daemon before it started accepting incoming connections

> journalctl -b -u sshd
    -- Logs begin at Fri 2016-10-21 23:16:04 EDT, end at Thu 2018-11-15 10:50:49 EST. --
    Nov 15 10:28:46 mgt systemd[1]: Started OpenSSH Daemon.
    Nov 15 10:31:51 mgt sshd[341]: Server listening on 0.0.0.0 port 22.
    Nov 15 10:31:51 mgt sshd[341]: Server listening on :: port 22.

Completely stock /etc/ssh config, and changing the OpenSSH Daemon to verbose e.g.

/etc/ssh/sshd_config 

LogLevel VERBOSE

does not yield any additional log info during daemon startup.

Any suggestions or additional thoughts on how to figure this out? 

Everything else seems in order

> systemd-analyze time
    Startup finished in 2.051s (kernel) + 675ms (userspace) = 2.727s
    graphical.target reached after 675ms in userspace

> systemd-analyze  blame
           497ms dev-sda2.device
           283ms systemd-hwdb-update.service
           200ms ldconfig.service
           138ms systemd-resolved.service
           137ms systemd-journald.service
           124ms systemd-journal-flush.service
           113ms systemd-udev-trigger.service
            69ms systemd-sysusers.service
            62ms lvm2-monitor.service
            42ms systemd-journal-catalog-update.service
            41ms systemd-networkd.service
            38ms systemd-tmpfiles-setup.service
            35ms user@1000.service
            31ms systemd-remount-fs.service
            19ms systemd-udevd.service
            19ms systemd-logind.service
            17ms sys-kernel-debug.mount
            16ms dev-hugepages.mount
            14ms dev-mqueue.mount
            14ms tmp.mount
            13ms systemd-sysctl.service
            12ms systemd-tmpfiles-setup-dev.service
            12ms systemd-tmpfiles-clean.service
            11ms kmod-static-nodes.service
             8ms sys-kernel-config.mount
             8ms systemd-update-utmp.service
             8ms user-runtime-dir@1000.service
             6ms systemd-random-seed.service
             6ms systemd-update-done.service
             6ms systemd-user-sessions.service

Last edited by tomz17 (2018-11-15 17:55:38)

Offline

#2 2018-11-15 16:16:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 6,757

Re: (SOLVED) Slow OpenSSH Daemon startup (3+ minutes!)

Likely the issue with the delayed random seed, try installing and enabling haveged or rng-tools

Offline

#3 2018-11-15 17:54:45

tomz17
Member
Registered: 2018-11-15
Posts: 2

Re: (SOLVED) Slow OpenSSH Daemon startup (3+ minutes!)

V1del wrote:

Likely the issue with the delayed random seed, try installing and enabling haveged or rng-tools

Fixed!  Thank you.  It was indeed the lack of entropy in the VM.

Installing haveged dropped daemon startup time to < 1 second

journalctl -b -u sshd
    -- Logs begin at Fri 2016-10-21 23:16:04 EDT, end at Thu 2018-11-15 12:50:34 EST. --
    Nov 15 12:50:20 mgt systemd[1]: Started OpenSSH Daemon.
    Nov 15 12:50:20 mgt sshd[321]: Server listening on 0.0.0.0 port 22.

Last edited by tomz17 (2018-11-15 17:55:06)

Offline

Board footer

Powered by FluxBB