Operating System - HP-UX
1820475 Members
2929 Online
109624 Solutions
New Discussion юеВ

finding the right sudoers file

 
Balki
Occasional Contributor

finding the right sudoers file

Hello team,

Is there anyway to find the correct sudoers file in a remote unix servers, which has multiple sudoers file at different location?

Thanks
5 REPLIES 5
SoorajCleris
Honored Contributor

Re: finding the right sudoers file

/etc/sudoers??

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Patrick Wallek
Honored Contributor

Re: finding the right sudoers file

Modify the file with 'visudo' (which will modify the correct sudoers file). Then look at all sudoers files for the one with the most recent modification time.

Patrick Wallek
Honored Contributor

Re: finding the right sudoers file

Also, when you invoke 'visudo' the path to current sudoers.tmp file will be shown at the bottom of the screen. This should be the location of the sudoers file as well.
muruganantham raju
Valued Contributor

Re: finding the right sudoers file

Hi,
Check /usr/local/etc/sudoers or /etc/sudoers

Regards,
Muru
Matti_Kurkela
Honored Contributor

Re: finding the right sudoers file

As root, run "sudo -V". It will display a lot of information about the compiled-in defaults of sudo... including the full path of the sudoers file it uses.

If you run "sudo -V" as a non-root user, it will only display the version number.

Example:

$ sudo -V
Sudo version 1.6.9p17
$

---------
# sudo -V
Sudo version 1.6.9p17

Sudoers path: /etc/sudoers
Authentication methods: 'pam'
Syslog facility if syslog is being used for logging: authpriv
Syslog priority to use when user authenticates successfully: notice
Syslog priority to use when user authenticates unsuccessfully: alert
[...]

MK
MK