Solved

Log a user's activity

Posted on 2000-03-27
7
285 Views
Last Modified: 2010-04-20
Is there any way in which I can log a specific user's activity? I've got a user, of the group user, login name user1. I want to log everything this user types in a file only accessible by root, and (if possible) all the output this user receives.
0
Comment
Question by:washoutt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2660800
I don't know of any built in way to do that. It sounds like you suspect this user of some sort of improper activity and if I knew a bit more about the situation I might be able to suggest alternatives.
0
 
LVL 4

Expert Comment

by:kiffney
ID: 2660952
If this is just for idle curiosity, then what you're planning to do is unethical, and if you did it to me I'd kick your ass.  If this is a security issue, you should read the Security-HOWTO at
http://howto.tucows.com/LDP/HOWTO/Security-HOWTO.html
0
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2661341
The file named .bash_history under the user's home directory logs everything the user types. It's the file responsible for the feature that allow you to press the up arrow and see the other command lines you've typed before, even after a shutdown. That doesn't stay in the RAM like in DOSKEY.

 So all you'd have to do is to create a script that would make a copy of that file of the user to be watched and add this script on the crontab to be run regularly. This way you'd keep an updated copy of it say every minute.

 To log the output the user get in the screen would be much harder, I really don't know how to do that. I don't think it's possible, also. But I think you can judge the user's actions from it's commands.

 Good luck!
0
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 

Expert Comment

by:ghins76
ID: 2663820
There is a superb program called "script" which gives you an entire transcript of everything that the user does.  It is part of a package called util-linux-2.9w-24. Just check it out.
0
 
LVL 2

Expert Comment

by:GP1628
ID: 2664564
Turning "history" on is a common thing for sysadmins to do if they suspect a user. The exact setting is different depending on what shell the user is using. (the last item on his line in /etc/passwd file, or doing a "fiinger" on his login may tell you) But history only shows what the person types.

If you really want to see what he gets back then you might try putting a "tee" command into his login file to pipe all of his stuff to a file and back to his console at the same time.

If he is hacking you its much easier (and more fun) to find a sniffer he leaves running and use his own snif logs against him. :-)

Gandalf  Parker
0
 

Accepted Solution

by:
hugonz earned 50 total points
ID: 2783396
If the user logs in via telnet, you can set up a telnet daemon in inetd.conf called ttysnoop

All the instructions are in /etc/inetd.conf itself. You should comment out ordinary in.telnet and uncomment this one. You are also instructed to read a man page...
0
 

Expert Comment

by:hugonz
ID: 2829247
Additional info....

Be aware that your typing into the other user's tty using ttysnoop will show on HIS/HER tty. This way you get control on his tty...

Also, they can see (if they're kinda proficient in Linux /Unix) that they can be snooped by typing
$ps aux

They'll see the in.ttysnoop (or the name of the daemon) instead of if.telnetd..anyway they're unable to tell if they're being snooped, but they can see it's enabled in the server.

Hugonz
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question