Show Contents

# Change root password

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

- Set the root password on a running system
- Set the root password at build time

## 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.

    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:

2. 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.

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:

3. Generate the new password hash.

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

4. Edit the local.conf file of your project to add the following lines:

    local.conf

    # Change the root password: (specify its MD5)
    MD5_ROOT_PASSWD = "<password_hash_output>"

5. Remove the debug-tweaks feature in your local.conf by commenting the following line:

    local.conf

    # We default to enabling the debugging tweaks.
    #EXTRA_IMAGE_FEATURES ?= "debug-tweaks"

6. Rebuild your project and upload the new root file system to the target.
7. The next time you login to the system, you must enter the username and established root password.

© 2018 Digi International Inc. All rights reserved.
Change root password updated on 22 January 2018 06:56:29 PM