1

How to logout from su-ed root at certain time

view story
linux-howto

http://unix.stackexchange.com – Suppose, the user does su, switching to root $su Password: bash-4.2# crontab -l How can I logout all such users from root at certain time? What I tried I know, that using this command: bash-4.2# ps -A -u root | grep bash 2303 tty1 00:00:00 bash 2548 pts/0 00:00:00 bash 3040 pts/0 00:00:00 bash 3080 pts/2 00:00:00 bash we can get all the bash shells, owned by root. But how to select the one, that was generated by su? When I ran echo $$ in the su-ed shell, it gives this: bash-4.2# echo $$ 3040 Then I tried bash-4.2# kill 3040 But it didn't kill the root shell. Pl (HowTos)