2

I want to log the logins/logouts of my users.

For the logins I only need to modify /etc/profile and add my command or edit any .profile for an specific user.

But for the logouts I don't know if there is a default/centralized way to do it like /etc/profile for logins.

I see some example for CLI sessions, but I want to register GUI/CLI sessions.

Thanks

Zanna
  • 70,465
raultm
  • 121
  • 3

1 Answers1

2

Found this thread: https://unix.stackexchange.com/questions/208277/how-can-i-set-a-bash-logout-for-all-users

From the manual (man bash):

When a login shell exits, bash reads and executes commands from the files ~/.bash_logout and /etc/bash.bash_logout, if the files exists.
CPH
  • 388
  • that is for CLI not for GUI, isn't it? – raultm Feb 17 '22 at 11:51
  • I know it works for CLI. Not sure about GUI however. If you are wanting specifically for GUI I must have misunderstood the question. I'm not sure of in that case – CPH Feb 17 '22 at 15:42