# sshd had to be restarted after upgrade to 12.4



## Nyantastic (Dec 15, 2022)

I upgraded two servers from 12.3-RELEASE to FreeBSD 12.4-RELEASE yesterday, and both servers allowed ssh logins initially, but then after some time ssh log in to the servers from elsewhere stopped working with messages of the form
`kex_exchange_identification: Connection closed by remote host`
I logged in to the servers using a keyboard and monitor and restarted the servers with
`service sshd restart`
and then things started working perfectly again.

I have searched with the site search and google for this message but did not find anything. I was able to solve this problem by restarting sshd so I don't need any help at the moment, but I thought it might be worth bringing up on the forum in case there is something I've missed.


----------



## cracauer@ (Dec 15, 2022)

No, this is a known issue. freebsd-update has been patched to avoid this the next time.


----------



## richardtoohey2 (Dec 15, 2022)

It caused confusion with 13.1 and got added to those release notes:









						FreeBSD 13.1-RELEASE Release Notes
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org
				






After upgrading, sshd (from OpenSSH 8.8p1) will not accept new connections until it is restarted. After installing the new userland, either reboot (as specified in the source update procedure), or execute service sshd restart.


But perhaps the same needs to go into the 12.4 release notes.


----------



## Nyantastic (Dec 15, 2022)

richardtoohey2 said:


> After upgrading, sshd (from OpenSSH 8.8p1) will not accept new connections until it is restarted. After installing the new userland, either reboot (as specified in the source update procedure), or execute service sshd restart.


The persons responsible for this text might want to make it a bit more clear that it requires a second reboot after the usual freebsd-update install / reboot / freebsd-update install cycle.


----------



## Eric A. Borisch (Dec 15, 2022)

Yeah, not sure why this didn’t get a big bold banner after the 13.1 experience.


----------



## richardtoohey2 (Dec 15, 2022)

Nyantastic said:


> The persons responsible for this text might want to make it a bit more clear that it requires a second reboot after the usual freebsd-update install / reboot / freebsd-update install cycle.



That's what this bit means:

_installing the new userland ... reboot_

The first freebsd-update installs the kernel, the reboot starts up with it, the second freebsd-update updates the userland - so the instructions do say to reboot after that.  Or if you don't want to reboot, use service sshd restart.

But yes, making it _very_ obvious that an extra step is required (whether reboot or service restart) would help reduce confusion, principle of least astonishment etc.


----------



## Nyantastic (Dec 15, 2022)

richardtoohey2 said:


> That's what this bit means:
> 
> _installing the new userland ... reboot_
> 
> ...



It should explicitly point out that the second "freebsd-update install" after rebooting makes the running sshd server require a restart.


----------



## covacat (Dec 15, 2022)

the best part is when you don't have access to servers's console and you just logged out
had to hack my own box to get ssh back on


----------

