sudo.conf is owned by uid 65534
Configuration
Ansible 2.9.10
Upgraded from ansible-automation-platform-setup-bundle-1.2.0-1, which I believe is Tower 3.8.
Really strange issue, I have two systems I testing against. First one is CentOS 6 and the second is CentOS 7.
The C7 hosts works fine.
C6 host : ok=188 changed=122 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
C7 host : ok=188 changed=122 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Output from C6 host
"msg": "privilege output closed while waiting for password prompt:\nsudo: /etc/sudo.conf is owned by uid 65534, should be 0\nsudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set\n",
"_ansible_no_log": false
Anyone seen this before. I am going to run against my lab environment, which has a combination of 6,7,8 hosts. But this one is stumping me.
When I run the playbook manually it works fine and I get the report I expect to see.
ansible-playbook ia_scan.yml -i test.inv -u -Kk
Responses
Solution article Why am I Receiving "sudo: effective uid is not 0, is sudo installed setuid root" using Ansible Tower? may be relevant?
Hi Gary Jarrell
Consider submitting a ticket with this if you are using Red Hat's Ansible tower, especially if for some reason, Ansible Tower has non-typical permissions.
Please see Akemi Yagi's post above. However, please validate the permissions for the files such as this:
I am only on a Fedora system tonight, so I'll update this tomorrow for RHEL, or perhaps someone can do this if they get to it before I do.
Find the rpm that installs /etc/sudo.conf. I'm currently on a Fedora system, so it is probably different.
yum provides */yumdownloader
You will get a lot of output, but it will tell you the rpm you need for that. Install the rpm
yum install name_of_rpm_without_the_version
# in fedora it was ' yum install dnf-utils' - but without the quotes
# it might be yum-utils on RHEL, I'll update this tomorrow
Now download the rpm
yumdownloader sudo
The command above will download the rpm for you in the directory you happen to be in. Next, run this command to get the permissions that are valid.
NOTE Make sure to replace the version you see below with the actual file you downloaded:
rpm -qplv sudo-1.9.2-1.fc32.x86_64.rpm | egrep "sudo.conf|sudoers" | egrep 'etc'
-rw-r--r-- 1 root root 5 Sep 15 11:07 /etc/dnf/protected.d/sudo.conf
-rw-r----- 1 root root 3985 Sep 15 11:07 /etc/sudo.conf
-r--r----- 1 root root 4375 Sep 15 11:04 /etc/sudoers
drwxr-x--- 2 root root 0 Sep 15 11:07 /etc/sudoers.d
Those are the permissions and ownership that should exist for the files from within the rpm.
By the way, the permissions for /etc/sudoers and /usr/bin/sudo is:
-r--r----- 1 root root 4375 Sep 15 11:04 /etc/sudoers
# and
---s--x--x 1 root root 186592 Sep 15 11:07 /usr/bin/sudo
To fix permissions, please examine this solution https://access.redhat.com/solutions/281923
rpm --setugids PACKAGE_NAME - sets user/group ownership of files in the given package.
rpm --setperms PACKAGE_NAME - sets permissions of files in the given package.
This may be excessive overkill, however, if you discover your permissions were actually wrong, then from a security perspective it might be useful to validate your rpms on the system you're dealing with using this Red Hat solution
Regards,
RJ
Hi Gary,
Red Hat folks will help you with the support ticket you placed.
The instructions above I gave would assist you to resolve any permissions issues and I cited the Red Hat solutions I garnered them from.
Let us know if you require anything from the discussion area, and cite this discussion in your case if you wish.
Regards,
RJ