Page 1 of 1

Default sudoers file

Posted: 2017/10/12 17:46:40
by jsm3031
Hello,

I have two CentOS VMs I used for certain tasks when I need them. I ran into an issue with running sudo from a script and I found the solution was to uncomment the "requiretty" option in the sudoers file.

What I'm puzzled about is when I went to apply the change in the other VM, it did not have this option.

The first VM has the following in its sudoers file

Code: Select all

# Defaults specification

# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
#         You have to run "ssh -t hostname sudo <cmd>".
#
Defaults    requiretty

#
# Refuse to run if unable to disable echo on the tty. This setting should also be
# changed in order to be able to use sudo without a tty. See requiretty above.
#
Defaults   !visiblepw


while the other has this

Code: Select all

# Defaults specification

#
# Refuse to run if unable to disable echo on the tty.
#
Defaults   !visiblepw


So the first is completely missing the requiretty line. I'm just really hung up on how they could have different sudoers files. I installed them both from CentOS-7-x86_64-Minimal-1611.iso. I've checked co-workers VMs and also an AWS instance and they all have the version without requiretty. Maybe a package I installed changed the sudoers file? I'd find that surprising...my last guess of what could cause this is choosing a different security policy during installation, but I really don't remember doing that.

If someone can confirm how this could have happened I'd appreciate it.

Thanks