Results 1 to 8 of 8

Thread: 'w' and 'who' commands: permission denied.

  1. #1
    Join Date
    Mar 2012
    Beans
    142

    'w' and 'who' commands: permission denied.

    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:

    Code:
    [~]$ 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.

  2. #2
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: 'w' and 'who' commands: permission denied.

    Look at the file permissions:
    Code:
    ls -l /var/run/utmp /var/log/*tmp
    Last edited by schragge; February 14th, 2013 at 12:00 PM.

  3. #3
    Join Date
    Mar 2012
    Beans
    142

    Re: 'w' and 'who' commands: permission denied.

    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.

  4. #4
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: 'w' and 'who' commands: permission denied.

    Hi

    Code:
    /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
    Last edited by matt_symes; February 14th, 2013 at 12:29 PM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  5. #5
    Join Date
    Oct 2006
    Beans
    58,286

    Re: 'w' and 'who' commands: permission denied.

    They can be run by a normal user, that is, without elevated priveleges.

  6. #6
    Join Date
    Oct 2011
    Beans
    53

    Re: 'w' and 'who' commands: permission denied.

    I would be more interested in the permissions of the files mentioned in the OP. So why not post the results of

    Code:
    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 :

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

  7. #7
    Join Date
    Mar 2012
    Beans
    142

    Re: 'w' and 'who' commands: permission denied.

    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--

  8. #8
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: 'w' and 'who' commands: permission denied.

    Quote Originally Posted by bantuvez View Post
    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
    Code:
    namei -l /usr/bin/w{,ho}
    is more informative in this regard.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •