How to change the root password
Published:  3 November 2016

The mangOH board comes with an empty (or unset) root password. This is great for development work on the bench - but not so good when you ship your project out into the big bad world.

Password tips

Set the root password to be a strong password that is unique to each board. Some tips1 for a secure password are:

  • Make the password length reasonably long (8-12 characters)
  • Use a mix of uppercase and lowercase letters, numbers and symbols
  • Don't use personal/company information or common words
  • Try not to use information that could 'leak' from the device (such as MAC or IP addresses) as the whole password
  • If you have more than one device in your 'fleet', don't use a common password across all devices

and

  • Keep your passwords secure
  • Have a password backup strategy in place
Note:

Passwords (and filenames for that matter) on the mangOH are CaSe SeNsItIvE.

So fred, Fred and FRED are all different passwords.

To change the root password

Changing the root password is straight forward.

Warning:

DO NOT FORGET OR LOSE THE ROOT PASSWORD

If you forget or lose the root password, you WILL be locked out of the mangOH board. The only way to recover from a lost password is to completely re-flash the mangOH board with a factory default image - and this will destroy all applications and data present on the board.

You have been warned!

  1. log into the mangOH board as root using ssh or via the serial console
  2. use the passwd command to change the password

    ~# 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:
    Re-enter new password:
    passwd: password changed.
    ~#

    If the password doesn't meet the default complexity you will be prompted to change your password - but you will be able to use a weak password anyway

    ~# 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:
    Bad password: too short.
    Warning: weak password (enter it again to use it anyway).
    New password:
    Re-enter new password:
    passwd: password changed.
    ~#
  3. Before logging out, open another ssh console and try to log in using the new password

And it's as easy as that.


  1. See Creating a strong password and Tips for Strong, Secure Passwords for futher recommendations about passwords.