Bug#1087644: openssh-server: no tty associated with login session
Package: openssh-server
Version: 1:9.9p1-3
Control: affects -1 bsdutils
Recently I've become aware of ssh sessions no longer showing a value for "TTY"
in w(1) and loginctl list-sessions. I think this leads to issues like wall(1) /
shutdown / ... not delivering messages to the terminals of users logged in via
ssh.
Just to clarify, what I'm seeing:
17:10 ch@tiksta:~ % w
17:10:57 up 1:30, 3 users, load average: 0.08, 0.04, 0.07
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
ch - 15:48 1:30m 0.00s 0.10s /usr/lib/systemd/systemd --user
ch tty2 - 17:02 8:57 0.05s 0.05s -zsh
ch 192.168.67.1 17:10 1:30m 0.00s 0.04s sshd-session: ch [priv]
The last of these entries is my session logged in via ssh. The running shell says:
17:10 ch@tiksta:~ % echo $TTY
/dev/pts/0
I would have expected w(1) to show pts/0 in the TTY column, like it did on
bookworm. Local logins (using login) still show a TTY in w(1), for
example the second entry in above's output.
loginctl also has no info on the TTY:
17:13 ch@tiksta:~ % loginctl list-sessions
SESSION UID USER SEAT LEADER CLASS TTY IDLE SINCE
2 1000 ch - 796 manager - no -
6 1000 ch seat0 40849 user tty2 no -
7 1000 ch - 40920 user - no -
(The last line should show pts/0 here.)
I don't know if the observed behaviour is an effect of utmp going
away, or caused by other changes in sshd. Could you please check
what's going on there?
Thanks,
Chris
Reply to: