Here is from a broken server running your version:

# /usr/lib/systemd/system/ssh.service
[Unit]
Description=OpenBSD Secure Shell server
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755

[Install]
WantedBy=multi-user.target
Alias=sshd.service

Here is mine which works, only thing I changed on ssh.service was the
path to the binary.

# /usr/lib/systemd/system/ssh.service
[Unit]
Description=OpenBSD Secure Shell server
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/local/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755

[Install]
WantedBy=multi-user.target
Alias=sshd.service

Here is from a server with your version, notice it is not listening to 443 even 
though I have it in the configuration:
# /usr/lib/systemd/system/ssh.socket
[Unit]
Description=OpenBSD Secure Shell server socket
Before=sockets.target ssh.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Socket]
ListenStream=22
Accept=no
FreeBind=yes

[Install]
WantedBy=sockets.target
RequiredBy=ssh.service

Here is from mine: # /usr/lib/systemd/system/ssh.socket
[Unit]
Description=OpenBSD Secure Shell server socket
Before=sockets.target ssh.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Socket]
ListenStream=22
Accept=no
FreeBind=yes

[Install]
WantedBy=sockets.target
RequiredBy=ssh.service

# /run/systemd/generator/ssh.socket.d/addresses.conf
# Automatically generated by sshd-socket-generator

[Socket]
ListenStream=
ListenStream=443
ListenStream=22

Notice it listens to port 443 as instructed.

From your version, notice it fails to allocate an X11 domain display
socket:


● ssh.socket - OpenBSD Secure Shell server socket
     Loaded: loaded (/usr/lib/systemd/system/ssh.socket; enabled; preset: 
enabled)
     Active: active (running) since Wed 2025-06-11 17:27:13 PDT; 5 days ago
   Triggers: ● ssh.service
     Listen: [::]:22 (Stream)
      Tasks: 0 (limit: 76666)
     Memory: 8.0K (peak: 256.0K)
        CPU: 481us
     CGroup: /system.slice/ssh.socket

Jun 11 17:27:13 igloo systemd[1]: Listening on ssh.socket - OpenBSD
Secure Shell server socket.

● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/usr/lib/systemd/system/ssh.service; disabled; preset: 
enabled)
     Active: active (running) since Thu 2025-06-12 03:42:51 PDT; 4 days ago
TriggeredBy: ● ssh.socket
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 3371578 ExecStartPre=/usr/sbin/sshd -t (code=exited, 
status=0/SUCCESS)
   Main PID: 3371579 (sshd)
      Tasks: 1 (limit: 76666)
     Memory: 4.9M (peak: 6.3M)
        CPU: 154ms
     CGroup: /system.slice/ssh.service
             └─3371579 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Jun 13 17:32:56 igloo sshd[4120297]: pam_unix(sshd:session): session opened for 
user root(uid=0) by root(uid=0)
Jun 14 15:44:35 igloo sshd[689282]: Accepted publickey for root from 
50.251.249.49 port 54284 ssh2: RSA 
SHA256:a5bReJXl7L91eGOuCYugHsY2rn2a0WTDXEBTC93YdmA
Jun 14 15:44:35 igloo sshd[689282]: pam_unix(sshd:session): session opened for 
user root(uid=0) by root(uid=0)
Jun 14 15:44:35 igloo sshd[689282]: error: Failed to allocate internet-domain 
X11 display socket.
Jun 15 16:44:51 igloo sshd[1231571]: Accepted publickey for root from 
50.251.249.49 port 60884 ssh2: RSA 
SHA256:a5bReJXl7L91eGOuCYugHsY2rn2a0WTDXEBTC93YdmA
Jun 15 16:44:51 igloo sshd[1231571]: pam_unix(sshd:session): session opened for 
user root(uid=0) by root(uid=0)
Jun 15 16:44:51 igloo sshd[1231571]: error: Failed to allocate internet-domain 
X11 display socket.
Jun 16 18:05:24 igloo sshd[1800016]: Accepted publickey for root from 
50.251.249.49 port 54780 ssh2: RSA 
SHA256:a5bReJXl7L91eGOuCYugHsY2rn2a0WTDXEBTC93YdmA
Jun 16 18:05:24 igloo sshd[1800016]: pam_unix(sshd:session): session opened for 
user root(uid=0) by root(uid=0)
Jun 16 18:05:24 igloo sshd[1800016]: error: Failed to allocate internet-domain 
X11 display socket.

On mine this does not happen:

● ssh.socket - OpenBSD Secure Shell server socket
     Loaded: loaded (/usr/lib/systemd/system/ssh.socket; enabled; preset: 
enabled)
    Drop-In: /run/systemd/generator/ssh.socket.d
             └─addresses.conf
     Active: active (running) since Fri 2025-06-13 19:33:41 PDT; 2 days ago
   Triggers: ● ssh.service
     Listen: [::]:443 (Stream)
             [::]:22 (Stream)
      Tasks: 0 (limit: 8759)
     Memory: 12.0K (peak: 264.0K)
        CPU: 936us
     CGroup: /system.slice/ssh.socket

Jun 13 19:33:41 ubuntu systemd[1]: Listening on ssh.socket - OpenBSD
Secure Shell server socket.

● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: 
enabled)
     Active: active (running) since Fri 2025-06-13 19:33:47 PDT; 2 days ago
TriggeredBy: ● ssh.socket
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 1593 ExecStartPre=/usr/local/sbin/sshd -t (code=exited, 
status=0/SUCCESS)
   Main PID: 1599 (sshd)
      Tasks: 37 (limit: 8759)
     Memory: 504.9M (peak: 2.7G swap: 1.4M swap peak: 32.8M)
        CPU: 5d 2h 18min 12.105s
     CGroup: /system.slice/ssh.service
             ├─   1599 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
             ├─  49311 /bin/bash ./iii
             ├─ 297412 "sshd: stosh [priv]"
             ├─ 299016 "sshd: stosh"
             ├─1510512 /bin/bash ./iii
             ├─1510513 /bin/bash ./iii
             ├─1510514 /usr/bin/python3 /home/dca/bin/add.py
             ├─1510515 sed "s/.*/scale=10;&*13.3336+0.5/"
             ├─1510517 bc
             ├─1510518 cut -d. -f1
             ├─2325938 "sshd: markjr [priv]"
             ├─2363513 "sshd: markjr@pts/0"
             ├─2363631 -bash
             ├─2572712 "sshd: bressler [priv]"
             ├─2573893 "sshd: bressler@pts/1"
             ├─2574173 -bash
             ├─2745898 "sshd: wormey [priv]"
             ├─2746976 "sshd: wormey@pts/6"
             ├─2747088 -tcsh
             ├─3472815 "sshd: bbrace [priv]"
             ├─3487252 "sshd: bbrace@pts/3"
             ├─3487499 -bash
             ├─3496206 alpine
             ├─3753117 /usr/libexec/geoclue-2.0/demos/agent
             ├─3929506 "sshd: stosh [priv]"
             ├─3930969 "sshd: stosh"
             ├─3990044 "sshd: witters [priv]"
             ├─3990377 "sshd: witters"
             ├─4162050 "sshd: luagha [priv]"
             ├─4178034 "sshd: luagha@pts/5"
             ├─4178520 -bash
             └─4182386 tf shadow

Jun 16 18:10:20 ubuntu sshd[1341578]: Disconnected from user lhowell 
71.169.174.67 port 56228
Jun 16 18:10:20 ubuntu sshd[1339336]: pam_unix(sshd:session): session closed 
for user lhowell
Jun 16 18:10:23 ubuntu sshd[1351522]: Accepted password for carl from 
50.251.249.54 port 51315 ssh2
Jun 16 18:10:23 ubuntu sshd[1351522]: pam_unix(sshd:session): session opened 
for user carl(uid=5530) by carl(uid=0)
Jun 16 18:10:23 ubuntu sshd[1351522]: pam_systemd(sshd:session): Failed to 
create session: No such process
Jun 16 18:10:26 ubuntu sshd[1351522]: pam_unix(sshd:session): session closed 
for user carl
Jun 16 18:10:49 ubuntu sshd[1407341]: Accepted password for carl from 
50.54.137.233 port 56619 ssh2
Jun 16 18:10:49 ubuntu sshd[1407341]: pam_unix(sshd:session): session opened 
for user carl(uid=5530) by carl(uid=0)
Jun 16 18:10:49 ubuntu sshd[1407341]: pam_systemd(sshd:session): Failed to 
create session: No such process
Jun 16 18:10:51 ubuntu sshd[1407341]: pam_unix(sshd:session): session closed 
for user carl

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2114144

Title:
  Openssh Server ignores Port xxx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/2114144/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to