Operations 11 min read

Why SSH Login Stalls on New UCloud Hosts: Entropy Delays and Kernel Bugs

A user reported extremely slow first SSH login on a UCloud “High‑Kernel Ubuntu 18.04” instance, which was traced to slow entropy‑pool initialization in the Linux kernel, a libssl 1.1.1 bug, and a kernel configuration issue, leading to a fix involving disabling MOTD or enabling CONFIG_RANDOM_TRUST_CPU.

Programmer DD
Programmer DD
Programmer DD
Why SSH Login Stalls on New UCloud Hosts: Entropy Delays and Kernel Bugs

1. Initial Investigation

A user experienced very slow first SSH login after creating a FastJet cloud host using the "High‑Kernel Ubuntu 18.04" image. The delay could last dozens of seconds or minutes.

Running ssh -v showed the client hanging after "debug1: pledge: network" while authentication had already succeeded, indicating the problem occurred after PAM processing in /etc/pam.d/sshd.

Disabling the motd line in the PAM configuration and restarting the host eliminated the delay.

Further analysis revealed that the motd mechanism runs scripts in /etc/update-motd.d/. The script 50‑landscape‑sysinfo invoked /usr/bin/landscape‑sysinfo, which caused the stall.

Stracing landscape‑sysinfo showed it blocked on the getrandom system call until /dev/urandom was fully initialized (around 23:10:48).

2. Deep Investigation

Comparing hosts showed that the problematic host used a newer version of landscape‑sysinfo that called getrandom with blocking flags, while a working host used an older version that did not.

Upgrading the working host reproduced the issue, confirming the version change as the cause.

Further testing identified that the libssl1.1 package upgrade to 1.1.1 introduced the blocking getrandom call, affecting any process that relied on libssl for random numbers (e.g., nginx with HTTPS).

Investigation of kernel logs indicated a known kernel bug (CVE‑2018‑1108) where getrandom could remain blocking after fast initialization. The bug was present in kernels 4.17–4.19 without the CONFIG_RANDOM_TRUST_CPU option enabled.

Enabling CONFIG_RANDOM_TRUST_CPU (which uses the CPU's RDRAND instruction to seed the entropy pool) or disabling the offending MOTD script resolved the delay.

3. Summary

The SSH login stall occurs when the following conditions are met:

Linux kernel version 4.17 or newer. CONFIG_RANDOM_TRUST_CPU is not set (or the CPU lacks RDRAND support).

The kernel bug affecting getrandom has not been reverted. libssl version 1.1.1 or newer is used.

Impact extends beyond SSH; any process using libssl for random numbers may block for several minutes after reboot, affecting services like HTTPS.

Fixes include enabling CONFIG_RANDOM_TRUST_CPU when building kernels 4.19+, disabling the MOTD script, or avoiding kernel versions 4.17–4.19 with the bug.

UCloud released updated images with the kernel option enabled and advises custom kernel users to avoid the vulnerable range or apply the relevant CVE patches.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linux kernelentropysystem performancecloud hostingSSHrandom numberlibssl
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.