Search code examples
linuxembedded-linuxyocto

How to set a root password in yocto which has dollar($) symbol


I am trying to set root password in my image recipe. I want to set a password which has '$' for example "abc$1234"

Following lines i have added in my image recipe

inherit extrausers
EXTRA_USERS_PARAMS = "usermod -P abc\$1234 root;"

When i login with 'abc$1234', it says wrong password.

Am i missing anything?


Solution

  • I'm using:

    EXTRA_USERS_PARAMS = "usermod -p 'abc\$1234' root;"
    

    Note the single quote around the passwd and a lower-case 'p'.