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
adminuser1
to sudoers in /etc/sudoers - Create a new file
/etc/sudoers.d/0001_admin1
and 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
adminuser1
tosudo
group and uncomment the# %sudo ALL=(ALL) ALL
in/etc/sudoers
- Adding
/etc/sudoers.d/0001_admin1
and adding onlyadminuser1 ALL=(ALL) ALL
in the file.