Processes launched from "su -" are not closed when killing terminal
1
vote
0
answers
68
views
I have a question regarding the processes launched via a SSH session, after having performed a
su - user
. My question applies to RHEL 8, but might as well to other O/S. The SSH connection is initiated from a Windows machine, but the behavior is the same when initiating a SSH connection from any other means.
The use case is the following:
- log as user
via SSH
- perform
sudo su -
to switch to root
- execute sleep 3000
- kill your SSH terminal (like close the mobaxterm window)
In this case, the process sleep 3000
keeps running.
This is not specific to the root
user. If I switch to the activemq user with su - activemq
, I have the same behavior.
However, if I run the command sleep 3000
from the user I used to connect via SSH without performing the su -
, killing the SSH terminal also kills the process, as expected.
Is this an expected behavior? And is there a way for this to prevent happening ?
Asked by TontonS
(11 rep)
Oct 22, 2024, 11:31 AM
Last activity: Oct 23, 2024, 01:03 PM
Last activity: Oct 23, 2024, 01:03 PM