문제

I was updating my Debian server in light of the Hearthbleed bug and it made me wonder: if I update a running Linux's sshd while connecting to it over SSH, what happens exactly? The sshd does not get restarted? Or it gets restarted and my ssh session is somehow transferred to the new sshd process?

도움이 되었습니까?

해결책

This is no Problem at all... You won't even notice.

Your current session continues to use the old binaries until you reconnect to the server. It is absolutely safe to install a new openSSH version while connected. Just make sure you restart the sshd service and on your next connect you will use the newly installed version.

다른 팁

The original daemon continues to run and host the existing sessions. Your existing connection will not be killed (it is unrelated to TCP timeouts as suggested by some comments).

You can verify this by

  1. Print your process table tree
  2. Find your sshd and its children
  3. restart sshd
  4. ssh to the server in a new window (do not close your existing connection)
  5. Print your process table tree again
  6. Find your sshd and its children and validate the process ids are identical.
  7. Find the new sshd daemon process running

If sshd did indeed kill your ssh session, then you would lose your bash shell no matter how "fast" it restarts compared to TCP timeout configurations.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top