Admin user is not prompted for password in sudo su

Last Updated : Jun 10, 2026 |

Solution

Procedure

The "90-cloud-init-users" file in /etc/sudoers.d/ gets created by cloud-init and adds the following rule for admin user:

For example, for an admin or adminitrative user, cloud-init adds the rule admin ALL=(ALL) NOPASSWD:ALL.

This file has limited permission. Even the "root" user has read-only access.

To overcome this problem, move "90-cloud-init-users" file to user's home dir.

For example, mv /etc/sudoers.d/90-cloud-init-users /home/admin/