Is it safe to close shell just by clicking X or using ctrl+d while logged in as root with su or is it safer to close it by typing exit? Is there any difference (security-wise) at all or is it the same and it does not matter which way you use?
Is it safe to close shell just by clicking X or using ctrl+d?
shell;terminal;security;root;exit
Ctrl-D or exit is the same.If you using the X, the window manager sends a terminate signal to the shell.Which has at the end the same result. If the shell does not react, the user usually gets a warning and can then force the shell to end (equal to kill -9 $PID).There is one small difference between the X- and exit-method if you are using zsh as shell: If you have a background process running, exit/ctrl-D produces the first time only a warning message you have running jobs, the second time the shell is closed. With the X button, the shell terminates immediately without any warnings.