Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 12195  / 2 Years ago, sat, september 3, 2022, 7:25:35

I know the who command showing me all logged in users. But I want to somehow informed when someone but me loggs into my system. Any applet? Would also be nice if the applet shows the number of distinct users logged in, meaning having a login shell and established ssh connection.


More From » login

 Answers
7

For the part of notification when someone loggs in your system, you could try to put a little script in a /etc/profile.d script. Using notify-send (part of the libnotify-bin package) you could try this :



/etc/profile.d/notify_log.sh



notify-send -t 3000 "User logged in" `whoami`


and then, every time someone will log in your system you will be notified.



EDIT:
So, it doesn't work well :(
If you configured a mail server on your machine, you can use the mail command instead of notify-send.



But according to the post here, the better solution would be a pam_exec script.


[#41137] Sunday, September 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
learty

Total Points: 432
Total Questions: 115
Total Answers: 109

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;