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
uservia SSH - perform
to switch tosudo su -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 ?
sleepas "user", do you get the same behavior?sleepas user, without performing thesu -first.