LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   Is it possible to hide users from the 'who' and 'w' commands? (https://www.linuxquestions.org/questions/general-10/is-it-possible-to-hide-users-from-the-who-and-w-commands-52101/)

BxBoy 03-27-2003 07:50 PM

Is it possible to hide users from the 'who' and 'w' commands?
 
Is it possible to omit users from being displayed with the 'who' and 'w' commands? Like for instance, I would like to omit the 'root' users from being displayed.

MasterC 03-27-2003 10:07 PM

According to the man page, I can't find anything on omitting a user, however you can specify a user:
w user username

So:
w user masterc
would tell you if I was logged into your machine and where :)

Cool

BxBoy 03-27-2003 10:11 PM

Yeah, but I'd like to omit users like 'root', so I can maintain my system while the users log in. I don't want them to know that I'm logged in.

Better yet, is there a source code for the 'w' or 'who' commands? I know a little programming, so maybe I can modify it and recompile it.

BxBoy 03-27-2003 10:26 PM

Nevermind. I thought of an ingenius way to do it! ;)

MasterC 03-27-2003 11:21 PM

Any insight? :)

crokett 03-28-2003 02:26 PM

Quote:

Originally posted by MasterC
Any insight? :)
Well a hack would be to alias the command to a shell script that pipes the output to a sed for root which deletes it before displaying the list to the user. The users don't know the difference.

cuckoopint 03-28-2003 06:45 PM

Quote:

Well a hack would be to alias the command to a shell script that pipes the output to a sed for root which deletes it before displaying the list to the user. The users don't know the difference.
heh. that's what I was thinking while reading this thread. But I was thinking maybe a simple grep -v

macewan 03-29-2003 09:28 PM

or a root kit

doublefailure 03-30-2003 01:33 AM

Quote:


heh. that's what I was thinking while reading this thread. But I was thinking maybe a simple grep -v
--V


All times are GMT -5. The time now is 02:23 PM.