#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    How to check which users have access to root and su command


    Hi All

    Is their a way by which i can know all the users who have access to su and root command ?

    Regards
    Shantanu
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,485
    Rep Power
    1752
    The actual location may vary depending on version (generally it will be /etc/sudoers) but you will want to check the contents of the sudoers file. Some implementations provide an editor (can't remember the command - I think its is visuodo, but it adds a syntax check on top of vi for you) but a man sudoers will give you the info you need to track it down.
    Once you have found the file you can examine it and find out who can do what - cross-referncing the data with the man page for sudoers to see what is what.

    Comments on this post

    • aitken325i agrees
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    Depends on whether you mean 'su' or 'sudo'. If it's the latter, then when Simon says above looking at 'sudoers' will tell you what you need to know. If you don't have any aliases defined, then look for lines that have something like
    Code:
    aitken325i    ALL=(ALL)       ALL
    As that line says that I have access to all run any commands as the root user using 'sudo'.

    However, if it's 'su', then you're looking at anyone who knows the root password. Looking through '/var/log/secure' will tell you who has become the root user and when using the 'su' command.
    The No Ma'am commandments:

    1.) It is O.K. to call hooters 'knockers' and sometimes snack trays
    2.) It is wrong to be French
    3.) It is O.K. to put all bad people in a giant meat grinder
    4.) Lawyers, see rule 3
    5.) It is O.K. to drive a gas guzzler if it helps you get babes
    6.) Everyone should car pool but me
    7.) Bring back the word 'stewardesses'
    8.) Synchronized swimming is not a sport
    9.) Mud wrestling is a sport
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0
    Try:

    cat /etc/group

    and look for the sudo group

    But firstly You should follow aitken and Simon responses bcoz these are the experienced person here ...

IMN logo majestic logo threadwatch logo seochat tools logo