sshd preauth child terminated by signal 31
Asked Answered
C

3

12

I upgraded to ubuntu 18.04 the other day, and since then I can't ssh to my machine again. The auth.log tells me this:

Jan 15 08:41:15 pc207 sshd[5358]: Accepted publickey for oscar from 10.60.0.15 port 42004 ssh2: RSA SHA256:59dtkmxMKMJG22+SQEoo7D55JSr+xlFjRyLMclLY210
Jan 15 08:41:15 pc207 sshd[5358]: debug1: monitor_child_preauth: oscar has been authenticated by privileged process
Jan 15 08:41:16 pc207 sshd[5358]: debug1: monitor_read_log: child log fd closed
Jan 15 08:41:16 pc207 sshd[5358]: fatal: privsep_preauth: preauth child terminated by signal 31

While ssh -vvv localhost tells me this:

debug1: Authentication succeeded (publickey).
Authenticated to localhost ([127.0.0.1]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
packet_write_wait: Connection to 127.0.0.1 port 22: Broken pipe

Google tells me to set UsePrivilegeSeparation to either yes, no or sandbox, but it does nothing. My /etc/ssh/sshd is unmodified.

EDIT: I upgraded my personal laptop to 18.04 as well (HP Elitebook 8570w, totally unrelated to above stationary Dell) and the exact same error is occurring when I try to ssh to my laptop; preauth child terminated by signal 31.

Conjunction answered 15/1, 2018 at 0:53 Comment(5)
Can you check the sshd_config with e.g. sshd -t?Orangeade
I think this would have happened because of changes in SSH server config and your config wouldn't have been replace by the latest one. I would suggest remove and purge sshserver and then make sure the /etc/ssh/sshd_config is delete (with a backup) and reinstall ssh server. Hopefully that should fix the issueMcghee
sshd -t passes. I removed and purged openssh-server and reinstalled it. No change in the configuration file from before, and still getting the same error.Conjunction
Have you tried to delete your previous keys in ~/.ssh/known_host and trying to SSH in your machine again ?Myca
@Myca tried now, no difference. :(Conjunction
W
1

Hope can help somebody who encounters the same issue, this problem make me struggling for at least two weeks...... Finally fixed it by modified the "sandbox" value to "yes", I don't know the logic, if somebody can help to explain why this works that would be appreciated : In sshd configuration file(/etc/ssh/sshd_config), you can find the line:

from:

UsePrivilegeSeparation sandbox # Default for new installations.

to

UsePrivilegeSeparation yes

Wehrmacht answered 4/7, 2018 at 8:12 Comment(0)
N
0

I struggled with this error for days. None of the solutions worked for me. I finally updated ssh server and it connected. It's a bummer. Wish I had a better answer.

Nomothetic answered 28/2, 2020 at 4:5 Comment(0)
O
-2

I had the same error now on my debian server after upgrade. After few hours of digging (the above solution was not helping), I've found that I was using lilo (due to sw raid on this quite old server) and the kernel version was not updated. I went from sarge to bullseye in the last couple of days (honestly, to get over the pains only once and have stable server for hopefully another 15 years :)) and the problem was that lilo.conf was not updated during this, so even the new testing was running on old 2.6. So after updating the lilo.conf and rebooting with new kernel, it started to work. BTW even the above sshd parameter UsePrivilegeSeparation is deprecated now (but it runs fine even without it.)

Ommiad answered 15/1, 2020 at 1:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.