Search code examples
yocto

Disable root login in yocto build


I am new in yocto project and I simply want to disable root login in yocto build image? I do not want my final image to ask me for login. Simply I need to flash my yocto image on sdcard and no login prompt shows.

Any help is appreciated.


Solution

  • If you are using systemd, in the file meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service change the ExecStart in the service to this :

    ExecStart=-/sbin/agetty -a USERNAME -8 -L %I @BAUDRATE@ $TERM
    

    change USERNAME to root or other.