Ederick Colmenares
Ederick Colmenares

Reputation: 41

How to change /etc/shadow permissions in yocto recipes?

I followed something like: https://wiki.yoctoproject.org/wiki/images/e/e6/Custom_Users_Groups_in_Yocto1.1.pdf but didn't work.

Expected results:

4.0K -r--r----- 1 root shadow 974 Jan 3 2001 /etc/shadow

I just want to do something like the example below within a recipe.

ExecStartPre=/bin/chmod 440 /etc/shadow ExecStartPre=/bin/chgrp shadow-user /etc/shadow

Does anyone knows which package contains or install the /etc/shadow file?

Thank you

Upvotes: 2

Views: 2385

Answers (1)

David Bensoussan
David Bensoussan

Reputation: 3215

Instead of changing a recipe, in your image recipe, you can try by adding:

ROOTFS_POSTPROCESS_COMMAND += "set_new_authorization; "
set_new_authorization () {
    chmod 660 ${IMAGE_ROOTFS}/etc/shadow
}

Upvotes: 5

Related Questions