Suppose that you issue apt-get upgrade
from an ssh session and one of the packages to be upgraded is openssh-server.
Is the new sshd process restarted after the upgrade? If yes how is the session maintained? If not, should I explicitly restart it or is there something I am missing?
Best Answer
When you connect in something like this happens
So ssh is forking off a new sshd process that has privilege separation. Also if you look at
lsof
You can see it also
So when you upgrade the main server will restart and be upgraded but your current ssh session will stay online. You can even restart ssh server from a ssh session these days without losing your connection.