Change root password

You can establish the root user password in one of two ways:

Set the root password on a running system

Note In pre-built Digi images, root user does not require a password to login to any image built with debug-tweaks. To build images with root password, see Set the root password at build time.

To create a new password for the running user:

  1. Execute the passwd command in your device shell and enter a new password.
  2. Device 
    #> passwd
    Changing password for root
    Enter the new password (minimum of 5 characters)
    Please use a combination of upper and lower case letters and numbers.
    New password: 
  3. Once the new password is set, log out or reboot the system.
    The next time you login to the system, you must enter the username and established password.
  4. Note This configuration will be persistent after reboots or power cycles.

    Set the root password at build time

    To establish the root user password at build time, follow these steps:

  5. Generate the new password hash.
  6. Storing a password hash instead of plain text protects critical information in case of unauthorized system access. To generate the hash of your desired password, execute the following command in your development PC and copy the output:

    Development PC 
    ~> echo -n <password> | mkpasswd -5 -s | sed -e 's,\$,\\$,g'

    For Debian-like distributions such as Ubuntu, the mkpasswd command is part of the whois package.

    Development PC 
    ~> sudo apt-get install whois
  7. Edit the local.conf file of your project to add the following lines:
  8. local.conf 
    # Change the root password: (specify its MD5)
    MD5_ROOT_PASSWD = "<password_hash_output>"
  9. Remove the debug-tweaks feature in your local.conf by commenting the following line:
  10. local.conf 
    # We default to enabling the debugging tweaks.
    #EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
  11. Rebuild your project and upload the new root file system to the target.
  12. The next time you login to the system, you must enter the username and established root password.