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:
- Execute the passwd command in your device shell and enter a new password.
- 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. - Generate the new password hash.
- Edit the local.conf file of your project to add the following lines:
- Remove the debug-tweaks feature in your local.conf by commenting the following line:
- Rebuild your project and upload the new root file system to the target.
- The next time you login to the system, you must enter the username and established root 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:
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:
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
local.conf
# Change the root password: (specify its MD5) MD5_ROOT_PASSWD = "<password_hash_output>"
local.conf
# We default to enabling the debugging tweaks. #EXTRA_IMAGE_FEATURES ?= "debug-tweaks"