linuxbuildrootusermode

How to add user to a group without usermod?


Is it possible to add a user to a group without usermod? I'm working on embedded Linux 3.14.52 and I don't have the usermod command line. If it is not possible, how add this command to kernel with Buildroot?


Solution

  • In Buildroot, users and groups are created with the BR2_ROOTFS_USERS_TABLES configuration option. Set it to a file or list of files or users you want to create. See section 9.6 of the Buildroot manual. Note that this only allows you to specify users; groups are created automatically when a user is assigned to a group.

    Alternatively, you can take control of the entire /etc/groups file by adding a filesystem overlay.

    To update the group configuration at runtime, you can use the addgroup and delgroup utilities in busybox.