Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Chromium OS root password? #209

Closed
wymby opened this issue Jun 10, 2013 · 6 comments
Closed

Change Chromium OS root password? #209

wymby opened this issue Jun 10, 2013 · 6 comments
Labels

Comments

@wymby
Copy link

wymby commented Jun 10, 2013

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

@dnschneid
Copy link
Owner

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

@wymby
Copy link
Author

wymby commented Jun 10, 2013

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

@coacherdoggiy
Copy link

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

@DaVolfman
Copy link

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

@DennisLfromGA
Copy link
Collaborator

@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

@liujustin604
Copy link

You can write an alias if you are used to using

sudo passwd root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants