Why doesn't the logout command terminate all processes in a user's ssh session?
You can use the logout command in ssh to terminate processes from a user's ssh session if you
change UseLogin from no to yes in /etc/ssh/sshd_config.
However, if using X11Forwarding in SSH changing UseLogin from no to yes prevents X11Forwarding from working in SSH.
This line should look like the following in /etc/ssh/sshd_config to disable X11Forwarding: #X11Forwarding no
To enable UseLogin in SSH do the following:
# vi /etc/ssh/sshd_config
Change this line from:
Stop and restart sshd.
# stopsrc -g ssh
# startsrc -g ssh
After making the above change when exiting an ssh session using the logout command all processes that were started within the ssh session will be terminated.
For more information on UseLogin and X11Forwarding please see the sshd man pages.