1, create the dev group with the root permission to execute the groupadd command. sudo groupadd dev2, create bpuser user with adduser command,--ingroup specify user to join the dev group. sudo adduser bpuser--ingroup dev3, using Userdel to remove the user sudo userdel-r bpuser4,ubuntu default has sudo group, users added to this group can use the sudo command without entering a password. Add users to the sudo group: sudo usermod-ag sudo bpuser5, set a user for a group, and use the sudo command to avoid entering a password each time. ① in the/etc/sudoers.d/directory, execute the visudo command to create a file (dev). sudo visudo-f/etc/sudoers.d/dev Note: Try not to edit the original settings file/etc/sudoers when setting up sudo individually. It's best to create your own settings file under/etc/sudoers.d/, like above. To prevent the OS upgrade from overwriting the original setup file/etc/sudoers, you need to reset it. ② edit the settings file Dev, enter the following:%dev all= (All) nopasswd:all Setup is complete, users of the dev group can use the sudo command without entering the password.
Ubuntu Append group, user, set free sudo password input