You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI : Does SSHD Service Restart Affect Current Active SSH Sessions

edited Sep 3, 2024 6:53AM in Linux 2 comments

Applies to:

Oracle Cloud Infrastructure - Version N/A and laterLinux x86-64

Goal

Need to know whether SSHD Service restart after making changes to sshd configuration will affect the current active SSH sessions

Solution

Restarting the SSHD service doesn't affect the current active SSH sessions, as it only kills and restarts the sshd main process. SSHD forks a child process on connection, these child process will not die if SSHD is restarted.

As per systemd unit file since sshd.service set KillMode=process, hence only the main process /usr/sbin/sshd gets killed on SSHD restart 

[root@xxxx ~]# cat /usr/lib/systemd/system/sshd.service

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!