Crouton: Change Chromium OS root password?

Created on 10 Jun 2013  路  6Comments  路  Source: dnschneid/crouton

Can I change the developer-mode root password (created when I set up an encrypted crouton chroot)? At the shell prompt, "sudo passwd" fails with "Authentication: token lock busy", apparently because /dev/root is mounted read-only. I can revert to user mode and start over, but is there an easier way?

(This is my first post -- just getting started with crouton and very impressed. Thanks!)

Bill

question

All 6 comments

The command you're looking for is sudo chromeos-setdevpasswd. Haven't figured out a good way to make that more discoverable for crouton users...

Thanks. Perhaps they'll find it here now..

it is still asking me for my password... I followed the command in the terminal

Like many modern linux systems It looks like you don't know the password for root once you use this command (it has probably actually been disabled). Instead you've set the password for an account named 'chronos' which has sudo access. (Looking at the /etc/shadow this account would seem to be similarly disabled, yet it works, which implies the authentication is done through some other system.)

@DaVolfman,

CrOS doesn't use /etc/passwd or /etc/shadow files in a strictly conventional way.
It does indeed use another system for user 'chronos', namely openssl

This is the chromeos-setdevpasswd script in it's entirety -

#!/bin/sh
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -e

PASSWD_FILE='/mnt/stateful_partition/etc/devmode.passwd'

# First get a password from the user before we go clobbering the content.
# This way they can run the script and CTRL+C out of it without breaking
# their existing password.
pass=$(openssl passwd -1)

mkdir -p "${PASSWD_FILE%/*}"
# Make sure it's created with permissions only root can access.
> "${PASSWD_FILE}"
chmod 600 "${PASSWD_FILE}"
echo "chronos:${pass}" > "${PASSWD_FILE}"

It sets an encrypted 'chronos' password in /mnt/stateful_partition/etc/devmode.passwd
When you attempt to open a shell from crosh, it will prompt you for the 'chronos' password.
Once that's satisfied and you are logged in a 'chronos', you can then use sudo without a password prompt.

-DennisL

You can write an alias if you are used to using
```
sudo passwd root
````

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anonymouseprogrammer picture anonymouseprogrammer  路  4Comments

Taylormsz picture Taylormsz  路  5Comments

Jacquelinemarie picture Jacquelinemarie  路  3Comments

Joshua10115 picture Joshua10115  路  4Comments

duck955 picture duck955  路  5Comments