User Tools

Site Tools


aix:aix_sudo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aix:aix_sudo [2021/12/06 17:26]
manu [SUDO options]
aix:aix_sudo [2023/08/17 01:02] (current)
manu
Line 1: Line 1:
 ====== SUDO options ====== ====== SUDO options ======
 +
 +Use **sudo -l** to list your privileges
 +
 +Use visudo instead of vi to edit a sudoers file
 +  # visudo -f /​etc/​sudoers.d/​oracle_priv
 +  ​
 +Check syntax on a file:
 +<cli prompt='#'>​
 +root@SERVER1:/​ # visudo -cf /​etc/​sudoers
 +>>>​ sudoers file: syntax error, line 95 <<<​
 +parse error in /​etc/​sudoers near line 95
 +</​cli>​
 +
 +<cli prompt='#'>​
 +root@SERVER2:/​ # visudo -cf /​etc/​sudoers
 +/​etc/​sudoers:​ parsed OK
 +/​etc/​sudoers.d/​generic:​ parsed OK
 +/​etc/​sudoers.d/​hosts-system:​ parsed OK
 +</​cli>​
  
 If you want to use LDAP integrating with sudo, install sudo_ids from RPM package, add also the option into /​etc/​netsvc.conf If you want to use LDAP integrating with sudo, install sudo_ids from RPM package, add also the option into /​etc/​netsvc.conf
Line 59: Line 78:
 </​code>​ </​code>​
  
-Example to rotate ​mailbox+Example to rotate ​sulog
 <cli> <cli>
-/var/spool/mail/​* ​+/var/log/sudo.log ​
 { {
            ​monthly            ​monthly
            ​rotate 2            ​rotate 2
-           ​olddir /​var/​log/​news/​old 
            ​missingok            ​missingok
 } }
Line 248: Line 266:
 further configuration further configuration
  
-This configuration is a basic one. It’s better to modify the configuration file /​etc/​security/​ldap/​ldap.cfg to better match your environment.+This configuration is a basic one. It’s better to modify the configuration file **/​etc/​security/​ldap/​ldap.cfg** to better match your environment.
  
 Here an example of a more complex configuration:​ Here an example of a more complex configuration:​
Line 306: Line 324:
   sudo configuration   sudo configuration
  
-Since a few months, IBM provides a sudo package with IBM Directory Server ldap + ssl support. The package is named sudo_ids. The minimum version is 1.8.20.+Since a few months, IBM provides a sudo package with IBM Directory Server ldap + ssl support. The package is named **sudo_ids**. The minimum version is 1.8.20.
  
 If you installed yum on AIX(highly recommended),​ the installation is really easy: If you installed yum on AIX(highly recommended),​ the installation is really easy:
Line 346: Line 364:
  
 You can also check if the sudo binary were built with ldap support by running this command: You can also check if the sudo binary were built with ldap support by running this command:
-<cli>+<​cli ​prompt='#'​>
 # sudo -V|grep ldap # sudo -V|grep ldap
  ​Configure options: --prefix=/​opt/​freeware --sbindir=/​opt/​freeware/​sbin --mandir=/​opt/​freeware/​share/​man --docdir=/​opt/​freeware/​share/​doc/​sudo_ids-1.8.20p2 --with-logging=syslog --with-aixauth --with-logfac=auth --without-pam --with-env-editor --with-ignore-dot --with-tty-tickets --with-ldap --with-ldap-conf-file=/​etc/​sudo-ldap.conf  ​Configure options: --prefix=/​opt/​freeware --sbindir=/​opt/​freeware/​sbin --mandir=/​opt/​freeware/​share/​man --docdir=/​opt/​freeware/​share/​doc/​sudo_ids-1.8.20p2 --with-logging=syslog --with-aixauth --with-logfac=auth --without-pam --with-env-editor --with-ignore-dot --with-tty-tickets --with-ldap --with-ldap-conf-file=/​etc/​sudo-ldap.conf
Line 353: Line 371:
 </​cli>​ </​cli>​
  
-It will also give you the place of the ldap configuration file for sudo. Here it’s /​etc/​sudo-ldap.conf.+It will also give you the place of the ldap configuration file for sudo. Here it’s ​**/​etc/​sudo-ldap.conf**.
  
 This configuration file is pretty simple to understand: This configuration file is pretty simple to understand:
Line 376: Line 394:
 In production, it’s better to store the bind dn password in the /​etc/​ldap.secret file. In production, it’s better to store the bind dn password in the /​etc/​ldap.secret file.
  
-It’s also mandatory to modify the /​etc/​netsvc.conf file to allow sudo to use LDAP.+It’s also mandatory to modify the **/​etc/​netsvc.conf** file to allow sudo to use LDAP.
 <cli> <cli>
 sudoers = files, ldap sudoers = files, ldap
 </​cli>​ </​cli>​
  
 +Example of syntax for /​etc/​sudoers file
 +  %wheel ALL=(ALL) NOPASSWD: ALL
 +  user01 ALL=NOPASSWD:/​usr/​sbin/​lsdev
 +  ​
aix/aix_sudo.1638808008.txt.gz · Last modified: 2021/12/06 17:26 by manu