Score:2

openssh failing with "client_loop: send disconnect: Broken pipe", but works in debug mode

us flag

I am trying to run openssh on my openwrt router. To test it, I start openssh via /usr/sbin/sshd -D. When I try to connect from my computer I get asked for the password and then (if the password is correct) the connection drops and client_loop: send disconnect: Broken pipe is shown in my terminal (bash, if someone is curious).

Now I tried to debug the problem, but when I run openssh in debug mode via /usr/sbin/sshd -D -d, then connecting just works and no error is encountered!

What could be the issue and how to fix it?

EDIT: As suggested by Michael Hampton, I had a log at the log using logread.

Sun Sep 26 13:31:40 2021 auth.info sshd[14488]: Accepted password for root from 192.168.2.50 port 48292 ssh2
Sun Sep 26 13:31:40 2021 auth.crit sshd[14488]: fatal: privsep_preauth: preauth child terminated by signal 12

Any ideas of how to fix that?

EDIT2: Information about the server, as suggested by Dennis Nolte:
OS: openwrt, built from master a couple of days ago
architecture: MIPS
CPU: MediaTek mt7621
kernel version: 5.10.x
openssl version: 1.1.1l
openssh version: 8.7p1
selinux enabled, but logs do not show any denials
PAM is available, but nothing changes if I select UsePAM=yes or no in sshd_config

Michael Hampton avatar
cz flag
Check the logs on the ssh server.
laolux avatar
us flag
Thanks, I had a look at the log (see edit), but I do not know how to fix that.
Michael Hampton avatar
cz flag
That's quite an odd one. Does that occur every time, or is the error different each time?
laolux avatar
us flag
Yes, it is actually extremely reliable. Only the port number changes, obviously.
Dennis Nolte avatar
us flag
please have a look at this debian bugreport and possible the openssh bugreport linked there, might help you -> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946242 seems this openbsh ssh-server bug might be related as well https://github.com/openssl/openssl/issues/9984
Dennis Nolte avatar
us flag
additionally it often helps tou post what Operating system you are using on the server, which Version of the Program (OpenSSH possibly) you have installed on the server, and additional security constraints you have like selinux or apparmor settings you or the initial installation of the server have set.
laolux avatar
us flag
Thanks, I read the github issue before, but that should well be fixed in my setup. I agree, adding system info is useful. Anyways, what is really bothering me is that running openssh with the debug option works just fine.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.