how to stop others users to stop viewing what i am doing ?

Hi ,

I have one question, suppose i am a normal user and when i use 'w' command , it shows who is logged on and what they are doing .
Now i want to stop others users to know what i am doing accept the root ?

can i do this ?

thanks

First post on these forums, so hello world :wink:
Some people may know me from bsdforums.org

If You have access to root account you can create script called w where the original w is egrepped [also renaming original w to some strange name, like scrub for example], and your script will be like that:

#! /bin/sh
scrub | egrep -v \^your_user_name
exit $?

But maybe there is some better sollution :wink:

Don't know why you would like to stop this...
Who cares if someone sees you are logged in and using vi or something...Unless your not meant to be there.

I can't see any security reason for it either as no privileged information is displayed. What is it that you don't want other users to see, what are you trying to hide ?

try it if you have access to r00t account

chmod 750 /usr/bin/w

so only users with gid=0 or uid=0 will can run the w
;D

And possibly break scripts running on thr system? As tornado said why would you care? Just learn to live with it, besides ps will tell them just as easily what you are doing.

In theory: Yes you can, if you bypass the 'standard login process' (which is another long story :smiley: ), but if you have root access nothing stop you from cleaning up the file 'w' uses to get those information (utmp,wtmp ... or something alike :smiley: )