I am using Yocto to build image for a board. I have disable the root user.
I am adding a new user, lets say adminuser1. As it looks to me there are two options to make adminuser1 as admin.
- Add
adminuser1to sudoers in /etc/sudoers - Create a new file
/etc/sudoers.d/0001_admin1and add a lineadminuser1 ALL=(ALL) ALL
The default /etc/sudoers has the sudo group commented # %sudo ALL=(ALL) ALL
I am trying to understand, as to which one is a better approach in terms of security:
- Shall I add
adminuser1tosudogroup and uncomment the# %sudo ALL=(ALL) ALLin/etc/sudoers - Adding
/etc/sudoers.d/0001_admin1and adding onlyadminuser1 ALL=(ALL) ALLin the file.