How to give a normal user access only to the /var/log directory?

20,408

Permission to view log files is granted to users being in the group adm.

To add a user to this group on the command line issue:

sudo usermod -aG adm <USER>
Share:
20,408

Related videos on Youtube

Program man
Author by

Program man

It's my passion and job... So I have to work on all flavors of Linux. I am launching my own company very soon in the IT sector. Thank you all for giving support and to start such a good platform for all Linux users. Ubuntu rocks... :) Please feel free to contact me in case of any query on [email protected]

Updated on September 18, 2022

Comments

  • Program man
    Program man over 1 year

    I have a non-admin user in Ubuntu 12.04 LTS desktop 32-bit OS to whom I need to give permissions only to access /var/log as he needs to monitor logs and create reports related to it.

    I do not want to give him admin access at any cost.

    How can I achieve this?

    • tombert
      tombert over 10 years
      Really depends on the way you want to go. You could give read permissions to world: "chmod a+r" or you could enable acl (Access Control List) on your hard-drive (its a mount option) which gives you lower granularity in setting read+write permissions.
    • Program man
      Program man over 10 years
      @tombert Agreed, but I was worried to do that, as to it can also affect the systems booting process, if set incorrectly. and I am not that used to with ACL. :P
  • Program man
    Program man over 10 years
    Thanks man it worked like a charm. But do you know where I can check the list of default permissions, of such system generated groups? I know that my English is not that great, hence let me know if you do not understand my question... it's perfectly fine with me! .... :P
  • Takkat
    Takkat over 10 years
    You may want to look that up with gnome-system-tools from the GUI: askubuntu.com/questions/66718/how-to-manage-users-and-groups‌​. The link I gave you in my answer also has a list of defaults - scroll up the page.
  • tombert
    tombert over 10 years
    Be aware that being in the adm group you can also sudo.
  • Takkat
    Takkat over 10 years
    @tombert nope - adm != admin it is in no way related to sudoers.
  • tombert
    tombert over 10 years
    @Takkat: thx, I mixed it up.
  • Program man
    Program man over 10 years
    @Takkat Appreciate your awesome answer pal... This is the Best possible and recommended solution for all Linux users .... workes like a wonder & does not give access to anything else apart tan logs... Great solution... Thanks again Takkat