Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have a quick question , This happened to me when I was logged in as a regular user in a production server . I was executing few commands , the person who was helping me was logged into the same host from another location (NY or something).I executed a script which is not accurate for that version of application running in the host . Then he pinged me via Microsoft communicator and instructed me not to use that script rather to use correct script for that version.
From then I was intrigued by how he found that out , I know that if one has root access he can view other users command history file but even root cannot tail the command history file.root can only cat the file once the user has ended the session.
Although "top -U username" will briefly show the command executed by the user.
Anyone here has any idea of how to tail other users commands or tail their command history file when they are in action.
Perhaps he just saw the results of the script and realised it was the wrong one? Is the script names differently? perhaps he ran the ps or top command?
Maybe he's paranoid and watches logged on users with the 'w' command. That'll tell him what you are doing. He can even tail it with the use of a fifo pipe.
Thanks devnull10,
Result of the script is not something logged anywhere or it doesnt leave any trace around , and yes the 2 scripts names are different.
Thanks EricTRA,
As far as i knew "w" command will only show who logged in from where and time. Am not sure about what you mean by "He can even tail it with the use of a fifo pipe" could you please elaborate
21:18:52 up 9:14, 5 users, load average: 0.73, 0.83, 0.67
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 - 12:06 6:20m 0.16s 0.01s /bin/sh /usr/bin/startx
root pts/0 :0 14:58 6:20m 0.00s 1.09s kded4
root pts/3 :0.0 20:59 0.00s 0.02s 0.00s w
You'll notice that with who you get what you mentioned. The output of w also lists what the logged on users are currently doing. A fifo pipe is like a wormhole to which you can send data. You create it using:
Code:
mkfifo nameyougive
and then you can send data to it from another console, another user, whatever you like. And you can follow it (fifo = first in first out) with the tail command on your console:
Code:
tail -f nameyougive
So if you then have like a little script that executes:
Code:
w > nameyougave
in a loop with a sleep interval of 30 seconds, you can kind of follow what your logged on users are doing.
The use of named pipe doesn't seem to work the expected way . whichever command (w , who , top -U <username>) doesn't seem to work the exact way as expected , none of the command redirected into the named pipe seems to show what that user is executing ,Is there any other way to accomplish the intial cause of this thread
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.