Hello community,
I have tried to change the user rights management of the Linux system I am using.
Instead of using root, I would like to add two new users. One as a “normal” user and one as a “sudo” user.
To solve this, I added the following lines to my local.conf:
inherit extrausers
EXTRA_USERS_PARAMS = "\
useradd -M -N -G sudo -p 'test01' sudo_user; \
useradd -M -N -G users -p 'test02' normal_user; \
"
This seems to work, as the users are listed in /etc/passwd and /etc/shadow.
To execute root commands, I also need the sudo command. To include this in my package, I added the following to local.conf:
IMAGE_INSTALL:append = " sudo"
This installs the sudo command in my package, but the permissions are incorrect and result in the following output:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
To solve this problem, I can change the permissions in the running system as follows:
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
But I need this directly as bitbake output.
Does anyone have any idea what I might have overlooked?
I am using Linux 6.12.20 for an iMX8M Mini based on the DDR4 EVK and the Bitbake image "fsl-image-machine-test".
The image “imx-image-multimedia” already includes sudo, but the permissions appear to be the same.