I have used many service providers, including AWS.In many service providers, the host needs a password, but AWS does not. AWS is a certificate login.However, after other service providers log on, sudo needs a password, while aws does not, which surprised me.After a series of explorations, I found the difference between AWS and other service providers.
This line refers to/etc/sudoers.dBelow (basically) all documents (refer to/etc/sudoers.d/README)
Then amazon installer creates/etc/sudoers.d/90-cloud-init-usersSuch a file has the following contents
# Created by cloud-init v. 0.7.5 on Sat, 14 May 2016 12:31:57 +0000# User rules for ubuntuubuntuALL=(ALL) NOPASSWD:ALL
It seems that the result is obvious,/etc/sudoersIt refers to the files of users who do not need passwords in sudo. Because of security, ubuntu does not recommend modifying them directly/etc/sudoersFiles, but contains/etc/sudoers.dDirectory. By creating a permission file in this directory, the password sudo is not requiredIn addition, this is the file information of 90 cloud init users:-r--r----- 1 root root 123 May 14 2016 90-cloud-init-users
Maintenance of the website requires a certain amount of expense. If you agree with this article, please close the advertisement blocker and browse the advertisement. Thank you!