#1101489 error: Bind to port 22 failed when ListenAddress is set

Package:
openssh-server
Source:
openssh-server
Description:
secure shell (SSH) server, for secure access from remote machines
Submitter:
odroid HC4
Date:
2025-03-28 12:09:02 UTC
Severity:
normal
#1101489#5
Date:
2025-03-28 10:44:27 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?


Debian12
openssh-server                  1:9.2p1-2+deb12u5    arm64

sshd starts before the ethernet interface gets an IP address.

With
ListenAddress 192.168.0.2
in
/etc/ssh/sshd_config

Result
error: Bind to port 22 failed: Cannot assign requested address.


systemctl edit sshd.service
and inserting the following:

    [Unit]
    After=network-online.target

does not help.

   * What outcome did you expect instead?

sshd active after reboot when ListenAddress is set in sshd_config


*** End of the template - remove these template lines ***

#1101489#10
Date:
2025-03-28 12:05:29 UTC
From:
To:
The problem was identified on a system that has a network interface
configured via dhcp.