Admin user is not prompted for password in sudo su

Last Updated : Mar 28, 2024 |
Prolog information

Solution

  1. The "90-cloud-init-users" file in /etc/sudoers.d/ gets created by cloud-init and adds the following rule for admin user:
    ADDITIONAL INFORMATION:
    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/