Skip to content

SSH sometimes doesn't listen on IPv4 0.0.0.0:1122 #13

@cmm-cisco

Description

@cmm-cisco

Problem traced to systemd drop-in for the ssh.socket.

https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html?__goaway_challenge=meta-refresh&__goaway_id=f5f1f710c5ccc04fc7092f5b38f23b0d&__goaway_referer=https%3A%2F%2Fwww.google.com%2F#Options

If the address string is a single number, it is read as port number to listen on via IPv6. Depending on the value of BindIPv6Only= (see below) this might result in the service being available via both IPv6 and IPv4 (default) or just via IPv6.

/usr/lib/systemd/system/ssh.socket:

…
BindIPv6Only=ipv6-only 

/usr/lib/systemd/system/ssh.socket.d/ssh.socket.conf:

[Socket]
ListenStream=
ListenStream=1122 

Should read:

[Socket]
ListenStream=
ListenStream=0.0.0.0:1122
ListenStream=[::]:1122

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions