11

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 no-more-sessions@openssh.com
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.

Oscar
  • 734
  • 2
  • 7
  • 23
  • Can you check the sshd_config with e.g. `sshd -t`? – ReyCharles Jan 23 '18 at 13:36
  • 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 issue – Tarun Lalwani Jan 23 '18 at 18:42
  • 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. – Oscar Jan 25 '18 at 04:35
  • Have you tried to delete your previous keys in `~/.ssh/known_host` and trying to SSH in your machine again ? – Jaay Jan 30 '18 at 15:00
  • @Jaay tried now, no difference. :( – Oscar Jan 31 '18 at 16:40

3 Answers3

0

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

BlackWidow
  • 11
  • 2
  • 6
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.

J.J
  • 633
  • 1
  • 6
  • 14
-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.)

Mr.JM
  • 11
  • 1