From
MD Mikka@21:1/5 to
All on Fri May 21 03:28:21 2021
Hello!
As it turns out the problem is using X11 Forwarding when X server is not running.
On Centos 8 (and probably on RHEL8) at login from Putty (with X11 forwarding) dbus-launches on the server (/etc/profile.d/ssh-x-forwarding.sh). If X11 server is not running the dbus-launch process remains alive on the same /dev/pts and it is stealing
keystrokes from bash.
In terminal I enter keys a,b,c,d,e,f,g and in the terminal I get: abeg
strace of dbus-launch process:
root@baraba1: ~# strace -p 1276525
strace: Process 1276525 attached
select(1, [0], NULL, [0], NULL) = 1 (in [0])
read(0, "c", 512) = 1
select(1, [0], NULL, [0], NULL) = 1 (in [0])
read(0, "d", 512) = 1
select(1, [0], NULL, [0], NULL) = 1 (in [0])
read(0, "f", 512) = 1
select(1, [0], NULL, [0], NULL
strace of bash:
root@baraba1: ~# strace -p 1276497
strace: Process 1276497 attached
read(0, "a", 1) = 1
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout)
write(2, "a", 1) = 1
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0])
read(0, "b", 1) = 1
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout)
write(2, "b", 1) = 1
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0])
read(0, "e", 1) = 1
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout)
write(2, "e", 1) = 1
pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0])
read(0, "g", 1) = 1
select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout)
write(2, "g", 1) = 1
pselect6(1, [0], NULL, NULL, NULL, {[], 8}
If this terminal hijacking from dbus-launch happens there is an easy remedy: just press Ctrl-C several times and dbus-launch will hijack ^C and exit :)
Well, disabling X11 forwardin when not needed is a good rule of thumb but for a better server-side solution I'll have to dig around RHEL bugzilla.
Why did the sshd run without problems on port 80? Because I ran it directly
# /usr/sbin/sshd -p 80
and X11Forwarding is disabled by default :)
I learned a lot while researching this issue and next time I can be more efficient.
Take care,
Miha
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)