Search code examples
user-interfaceauthenticationembedded-linuxyocto

How can I add a user to login as a user and not as a root Yocto project sama5d27 board


I am using sama5d27 som1 ek1 board and I build a Linux kernel for it using yocto project. I open minicom and the system boot. I want to remove debug tweaks from my image features but I must now set a user to my board to login and stop login as a root. How can I add a user to my board ?


Solution

  • You have to use one of the useradd classes. The documentation is there: https://docs.yoctoproject.org/dev/ref-manual/classes.html#useradd

    The meta-skeleton/recipes-skeleton/useradd/useradd-example.bb recipe show you how to do that dynamically.

    You can also provide the uids and gids statically by using USERADDEXTENSION = "useradd-staticids" in local.conf or, preferably in your distro and then having files/passwd and files/group anywhere in your BBPATH.