Hi all,<div>I'm trying to remove an element from my sudoers file on a CentOS 5.5 machine running augeas 0.7.3.<div><br></div><div><div>augtool> rm /files/etc/sudoers/Defaults[1]/requiretty</div><div>rm : /files/etc/sudoers/Defaults[1]/requiretty 1</div>
<div>augtool> save</div><div>Saving failed</div><div>augtool> print /augeas//error</div><div>/augeas/files/etc/sudoers/error = "put_failed"</div><div>/augeas/files/etc/sudoers/error/path = </div><div>"/files/etc/sudoers/Defaults"</div>
<div>/augeas/files/etc/sudoers/error/lens = </div><div>"/usr/share/augeas/lenses/dist/sudoers.aug:398.17-399.41:"</div><div>/augeas/files/etc/sudoers/error/message = "Failed to match \n    { /type/ = /[:>@][^\\001-\\004\\t\\n \\\\]+/ }?({ /always_set_home|authenticate|env_editor|env_reset|fqdn|ignore_dot|ignore_local_sudoers|insults|log_host|log_year|long_otp_prompt|mail_always|mail_badpass|mail_no_host|mail_no_perms|mail_no_user|noexec|path_info|passprompt_override|preserve_groups|requiretty|root_sudo|rootpw|runaspw|set_home|set_logname|setenv|shell_noargs|stay_setuid|targetpw|tty_tickets/ } | { /passwd_tries/ = /[0-9]+/ } | { /((loglinelen|passwd_timeout|timestamp_timeout|umask))|((loglinelen|passwd_timeout|timestamp_timeout|umask))/ = /(([0-9]+))/ } | { /badpass_message|editor|mailsub|noexec_file|passprompt|runas_default|syslog_badpri|syslog_goodpri|timestampdir|timestampowner|secure_path/ = /[^\\001-\\004\\t\\n \\\"#,=\\\\]+/ } | { /((exempt_group|lecture|lecture_file|listpw|logfile|mailerflags|mailerpath|mailto|exempt_group|syslog|verifypw|logfile|mailerflags|mailerpath|mailto|syslog|verifypw))|((exempt_group|lecture|lecture_file|listpw|logfile|mailerflags|mailerpath|mailto|exempt_group|syslog|verifypw|logfile|mailerflags|mailerpath|mailto|syslog|verifypw))/ = /(([^\\001-\\004\\t\\n \\\"#,=\\\\]+))/ } | { /((env_check|env_delete|env_keep))|((env_check|env_delete|env_keep))/ })({ /always_set_home|authenticate|env_editor|env_reset|fqdn|ignore_dot|ignore_local_sudoers|insults|log_host|log_year|long_otp_prompt|mail_always|mail_badpass|mail_no_host|mail_no_perms|mail_no_user|noexec|path_info|passprompt_override|preserve_groups|requiretty|root_sudo|rootpw|runaspw|set_home|set_logname|setenv|shell_noargs|stay_setuid|targetpw|tty_tickets/ } | { /passwd_tries/ = /[0-9]+/ } | { /((loglinelen|passwd_timeout|timestamp_timeout|umask))|((loglinelen|passwd_timeout|timestamp_timeout|umask))/ = /(([0-9]+))/ } | { /badpass_message|editor|mailsub|noexec_file|passprompt|runas_default|syslog_badpri|syslog_goodpri|timestampdir|timestampowner|secure_path/ = /[^\\001-\\004\\t\\n \\\"#,=\\\\]+/ } | { /((exempt_group|lecture|lecture_file|listpw|logfile|mailerflags|mailerpath|mailto|exempt_group|syslog|verifypw|logfile|mailerflags|mailerpath|mailto|syslog|verifypw))|((exempt_group|lecture|lecture_file|listpw|logfile|mailerflags|mailerpath|mailto|exempt_group|syslog|verifypw|logfile|mailerflags|mailerpath|mailto|syslog|verifypw))/ = /(([^\\001-\\004\\t\\n \\\"#,=\\\\]+))/ } | { /((env_check|env_delete|env_keep))|((env_check|env_delete|env_keep))/ })*\n  with tree\n   "</div>
</div></div><div><br></div><div><br></div><div>Below are the contents of my sudoers file (which is basically the default CentOS sudoers file except the lines at the end).  Thanks for reading!</div><div><br></div><div><br>
</div><div><div>## Sudoers allows particular users to run various commands as</div><div>## the root user, without needing the root password.</div><div>##</div><div>## Examples are provided at the bottom of the file for collections</div>
<div>## of related commands, which can then be delegated out to particular</div><div>## users or groups.</div><div>## </div><div>## This file must be edited with the 'visudo' command.</div><div><br></div><div>## Host Aliases</div>
<div>## Groups of machines. You may prefer to use hostnames (perhap using </div><div>## wildcards for entire domains) or IP addresses instead.</div><div># Host_Alias     FILESERVERS = fs1, fs2</div><div># Host_Alias     MAILSERVERS = smtp, smtp2</div>
<div><br></div><div>## User Aliases</div><div>## These aren't often necessary, as you can use regular groups</div><div>## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname </div><div>## rather than USERALIAS</div>
<div># User_Alias ADMINS = jsmith, mikem</div><div><br></div><div><br></div><div>## Command Aliases</div><div>## These are groups of related commands...</div><div><br></div><div>## Networking</div><div>Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool</div>
<div><br></div><div>## Installation and management of software</div><div>Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum</div><div><br></div><div>## Services</div><div>Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig</div>
<div><br></div><div>## Updating the locate database</div><div>Cmnd_Alias LOCATE = /usr/bin/updatedb</div><div><br></div><div>## Storage</div><div>Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount</div>
<div><br></div><div>## Delegating permissions</div><div>Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp </div><div><br></div><div>## Processes</div><div>Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall</div>
<div><br></div><div>## Drivers</div><div>Cmnd_Alias DRIVERS = /sbin/modprobe</div><div><br></div><div># Defaults specification</div><div><br></div><div>#</div><div># Disable "ssh hostname sudo <cmd>", because it will show the password in clear. </div>
<div>#         You have to run "ssh -t hostname sudo <cmd>".</div><div>#</div><div>Defaults    requiretty</div><div><br></div><div>Defaults    env_reset</div><div>Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \</div>
<div>                        LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \</div><div>                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \</div><div>                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \</div>
<div>                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \</div><div>                        _XKB_CHARSET XAUTHORITY"</div><div><br></div><div>## Next comes the main part: which users can run what software on </div>
<div>## which machines (the sudoers file can be shared between multiple</div><div>## systems).</div><div>## Syntax:</div><div>##</div><div>## <span class="Apple-tab-span" style="white-space:pre">     </span>user<span class="Apple-tab-span" style="white-space:pre">        </span>MACHINE=COMMANDS</div>
<div>##</div><div>## The COMMANDS section may have other options added to it.</div><div>##</div><div>## Allow root to run any commands anywhere </div><div>root<span class="Apple-tab-span" style="white-space:pre">    </span>ALL=(ALL) <span class="Apple-tab-span" style="white-space:pre">  </span>ALL</div>
<div><br></div><div>## Allows members of the 'sys' group to run networking, software, </div><div>## service management apps and more.</div><div># %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS</div>
<div><br></div><div>## Allows people in group wheel to run all commands</div><div>#%wheel<span class="Apple-tab-span" style="white-space:pre">    </span>ALL=(ALL)<span class="Apple-tab-span" style="white-space:pre">   </span>ALL</div>
<div><br></div><div>## Same thing without a password</div><div># %wheel<span class="Apple-tab-span" style="white-space:pre">      </span>ALL=(ALL)<span class="Apple-tab-span" style="white-space:pre">   </span>NOPASSWD: ALL</div>
<div><br></div><div>## Allows members of the users group to mount and unmount the </div><div>## cdrom as root</div><div># %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom</div><div><br></div><div>## Allows members of the users group to shutdown this system</div>
<div># %users  localhost=/sbin/shutdown -h now</div><div>hudson  ALL=(ALL) NOPASSWD: SOFTWARE,NOPASSWD: SERVICES,NOPASSWD: /usr/sbin/httpd</div><div>%wheel ALL = (ALL) ALL</div></div><div><br></div>