LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-08-2017, 10:49 PM   #1
Sol33t303
Member
 
Registered: Jul 2017
Distribution: gentoo
Posts: 115

Rep: Reputation: Disabled
How can I make Linux log things that a user does?


Right now I'm doing a homework project for CS that requires me to write down everything that I do on my PC for a week. Because that would be extremely tedious, I'm getting Linux to do that for me. I'm aware that Linux already logs most user activity, but there are a few things that it doesn't (from what I can tell). I would like to be able to get Linux to record what programs I have opened, what websites I have accessed, how long I was using it for, etc. It would be ideal if it could group everything into two hour blocks and not require too much editing to make it look nice (this is a group project so I want it to be easy to read). How can I do this? I'm running Fedora 27. (I also posted this in the general section, but I think people here will probably know more about logging, though it's not really in a security context)
 
Old 12-09-2017, 03:44 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i doubt a readymade software exists for that!
a combination of Xorg logs and a keylogger might be enough.
or you have to really actually record your screen all the time, but that would create enormous output!
 
Old 12-09-2017, 04:01 AM   #3
Sol33t303
Member
 
Registered: Jul 2017
Distribution: gentoo
Posts: 115

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
i doubt a readymade software exists for that!
a combination of Xorg logs and a keylogger might be enough.
or you have to really actually record your screen all the time, but that would create enormous output!
Somebody in the general section suggested recording, but I don't have enough space for the output + it would take ages to sift through all the recording, so I'm not doing that, especially since I keep my system on 24/7. I might be able to write my own python or bash script that can detect when the system tries to request a web page from a server and to write the IP and the time that it happened in a file somewhere, but I'm not really sure how I would do the same for everything else. I'm currently running XWayland, I'm not sure if XWayland logs files but I would presume it does, so they should be helpful (I could potentially write another script that reads changes to those logs and puts certain parts of it into a file or something similar). It's disappointing that there aren't any software made for this kind of thing, I'm sure some people would find it useful.
 
Old 12-09-2017, 04:23 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i'm sure wayland logs.
that, plus a keylogger, should go 75% of the way.

Quote:
Originally Posted by Sol33t303 View Post
It's disappointing that there aren't any software made for this kind of thing, I'm sure some people would find it useful.
have you searched?
 
Old 12-09-2017, 04:30 AM   #5
Sol33t303
Member
 
Registered: Jul 2017
Distribution: gentoo
Posts: 115

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
i'm sure wayland logs.
that, plus a keylogger, should go 75% of the way.


have you searched?
Yeah, like I said I presume it does. Yeah, I have done some searching, you and the people on the thread I created in the general section also haven't heard of software that does this so it sounds like it probably doesn't exist. A keylogger and wayland logs should be most of what I need. but like you said that's only 75% and I would prefer to be able to log everything if possible (though I don't really need it to go into tons of details).

Last edited by Sol33t303; 12-09-2017 at 04:33 AM.
 
Old 12-09-2017, 12:21 PM   #6
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 688
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
GNU software acct

try GNU software acct/. It may already be on your system

Last edited by jmccue; 12-09-2017 at 12:22 PM. Reason: grammer
 
Old 12-09-2017, 01:06 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Sol33t303 View Post
Yeah, I have done some searching, you and the people on the thread I created in the general section also haven't heard of software that does this so it sounds like it probably doesn't exist.
that's NOT what i meant by "searching".
 
Old 12-12-2017, 06:20 AM   #8
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Post Impossible

The things you want to log are on too much different levels to be scanned by a single program. Happily GNU/Linux isn't micro$oft window$ NT and so it don't send to a telemetry micro$oft server everything the user does.
 
1 members found this post helpful.
Old 12-12-2017, 10:04 AM   #9
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
For what you did in a browser there is since ages a browser history in any browser I can remember.

ps -aux (or ps aux, whatever the syntax is). same since suse 6.2 or earlier

--

I agree it boils down what you want to gather. Than you need to use some sort of daemon and logfile. Whatever you call it

--

Gathering data is one point.

Using that data in some sort of fashion is the other issue.

You better combine that so you do not end up with lots of useless data.

--

/var/log/messages at least tells you when the box had booted, and I am quite sure when you have shut it down.

It has a decent timestamp, AFAIK in seconds since DAY X, Time Y-Z-A

I would set an alias for all your user software which includes spamming a single line to messages.
You may find a way also to log when you terminate a process somehow.

So you have a nice logfile which you can parse.

--

Also read what the kernel has to offer. I think there are some "debug" features which can be for sure abused in this fashion too.
 
Old 12-12-2017, 11:56 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
if you speak about yourself, you can use the tool screen, see the option -L.
 
Old 12-12-2017, 04:51 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Sol33t303 View Post
Right now I'm doing a homework project for CS that requires me to write down everything that I do on my PC for a week.
How is "capturing" anything fulfilling that requirement?

Experience is often "very tedious" to acquire, and writing things down supports memory and learning.

I think you are missing the reason for the writing.

tedious? Wait until you have to physically read
Code:
man bash
!!

I'd ask the teacher if "logging" will suffice. You may find out something you didn't know.

Good Luck.
 
Old 12-18-2017, 01:00 PM   #12
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Habitual View Post
How is "capturing" anything fulfilling that requirement?

Experience is often "very tedious" to acquire, and writing things down supports memory and learning.

I think you are missing the reason for the writing.

tedious? Wait until you have to physically read
Code:
man bash
!!

I'd ask the teacher if "logging" will suffice. You may find out something you didn't know.

Good Luck.
To add to this, the point of the assignment may have absolutely nothing to do with exacting duplication of commands and/or mouse clicks. Instead it may have to do with a higher level of awareness as to what people use computers for. Perhaps what your instructor is looking for instead is:
  • Surfing the web
  • Reading email
  • Writing documents
And maybe they'll want an estimate of time spent doing those things.

One reason why I'm saying exactly this is because of having been given similar assignments, done exactly what the mass of people do, which is to find one or several highly detailed technical answers. Only to find out that most of us were 100% incorrect. There's always that one student who gets the gold star and answered what the teacher really was looking for.
 
2 members found this post helpful.
Old 12-19-2017, 04:11 AM   #13
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
+1 #12. Yes, ask instructor for clarification.
(IF a concepts class & instructor doesn't say "yes, every cmd/www-page/...",
especially then it may be the 'trick'/conceptual question #12 suggests!!!)

Quote:
Just about everything you do on your PC begins—or can begin—with your Start menu.
https://www.safaribooksonline.com/li...8272/ch01.html

https://www.labnol.org/software/orga...activity/3817/
https://www.rescuetime.com/

Last edited by !!!; 12-19-2017 at 04:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make Linux log things that a user does? Sol33t303 Linux - General 3 12-08-2017 07:35 PM
LXer: Top 25 things to do after installing Linux Mint 18 (Sarah) to make as user friendly LXer Syndicated Linux News 0 07-08-2016 08:36 AM
LXer: Top 22 things to do after installing Fedora 24 to make as user friendly LXer Syndicated Linux News 0 06-24-2016 12:18 AM
LXer: Make things 'til you make it at the Blowing Things Up Lab LXer Syndicated Linux News 0 06-14-2016 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration