PDA

View Full Version : [xubuntu] 'w' and 'who' commands: permission denied.



kleenex
February 14th, 2013, 11:48 AM
Hi, Could anybody tell me if w and who commands can't be running by a normal user due to permission denied? In this case, it looks in this way:


[~]$ w
bash: /usr/bin/w: Permission denied

[~]$ who
bash: /usr/bin/who: Permission denied So, it is normal on a default Xubuntu 12.04 installation? I'm sorry for asking, but for now I have no possibility to check/verify it and it's pretty important.

Thanks.

schragge
February 14th, 2013, 11:56 AM
Look at the file permissions:


ls -l /var/run/utmp /var/log/*tmp

kleenex
February 14th, 2013, 12:23 PM
Hi schragge. Sorry for asking, but what does that have to do with my question? Okay: /var/log/*tmp: No such file or directory and /var/run/utmp is owned by root and utmp.

matt_symes
February 14th, 2013, 12:26 PM
Hi


/var/run/utmp is owned by root

That may be the problem.

Can you post the output of

ls -l /var/run/utmp

to check the read permissions.

Kind regards

howefield
February 14th, 2013, 12:27 PM
They can be run by a normal user, that is, without elevated priveleges.

bantuvez
February 14th, 2013, 01:14 PM
I would be more interested in the permissions of the files mentioned in the OP. So why not post the results of



ls -l /usr/bin/w ?

And because at me it is a link to /etc/alternatives/w which is a link to /usr/bin/w.procps :



ls -l /etc/alternatives/w /usr/bin/w.procps

kleenex
February 14th, 2013, 10:43 PM
Hi, I will do this everything, which You have asked for. But for now I would like to know if e.g. turn off the SUID bit (with chmod -s command) from those files, may cause these Permission denied problems? But generally: it is normal and default result for the average user who's trying to run w and who commands?

matt_symes; /var/run/utmp file -rw-rw-r--

schragge
February 15th, 2013, 08:08 AM
I would be more interested in the permissions of the files mentioned in the OP.Although I doubt you'll find anything unusual there, I think

namei -l /usr/bin/w{,ho} is more informative in this regard.