Howto know each ssh users logs in at least every 24hrs
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Howto know each ssh users logs in at least every 24hrs
Hello! I frequently use different computers in different cities to work off (this cannot be changed) and I have them rsync everyday to one of my servers @ home. What I am trying to accomplish is a small admin webpage listing everyday my last sync and that my backup was successful. I was thinking maybe just dumping this data into an html file and using apache to view it via the http protocol. I created something similar to this that uses simple shell scripts to see if "backup_log" exists and then cross-checking it's date with todays date to see if it backed up today. BUT, I find sometimes a backup finished at 12:01 AM for say and my script things the back never happened (until tomorrow). Would it be better to check the backup_logs date with a 24 hour check thing? (Maybe in Perl, I don't know much perl, or can this be done via shell scripts?)
Or maybe grep through /var/log/messages for that users account ssh login crosschecked by there last login and make sure it hasn't been over 24 hours? (i'm using ssh to transfer the file via rsync). Do anyone know any scripts that may help me, or do you know a better way to accomplish this so i know every user i specify logs in every 24 hours at least via ssh? Again my main goal is knowing every PC logs in under 24 hours, so anyone suggestions would be appreciated if you think it would work.
Thanks for the suggestion. After the daily backups, I would have a bunch of emails, correct? I was looking for something like a single webpage or a single email that would show all my users successful login instead of a few single emails. I'll look into nail and see if there are any options that may be useful, thank you very much for the suggestion.
Then download the sync.log file say at 12:30 with a crontab or if there is a web server
running on each machine with php, you could just do a php script :
I also found when a user logs in, a line is added to /var/log/messages that looks like this:
Apr 20 00:20:29 oscar sshd[24257]: Accepted publickey for gian from 208.47.17.112 port 2034 ssh2
How about if I make a script that checks every 24 hours and crosschecks that date above to the last 24hours? Would that work? It seems pretty simple too. If that is suitable, would it be an easy script to write or would it be wise to hire a freelance programmer to draft it up?
Thanks for your suggestions I think I'm getting pretty far,
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.