all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tonton <tonton@riseup.net>
To: znavko@tutanota.com
Cc: Help Guix <help-guix@gnu.org>
Subject: Re: Single user mode in GuixSD
Date: Sat, 1 Dec 2018 18:13:21 +0100	[thread overview]
Message-ID: <20181201181321.170f2497@merlin.browniehive.net> (raw)
In-Reply-To: <LS_LtWt--3-1@tutanota.com>

On Fri, 30 Nov 2018 17:02:41 +0100 (CET)
<znavko@tutanota.com> wrote:

> Hello, Guix Help! Once I've lost root password and need to restore root
> password in GuixSD.

You can fix this quite quick and easy. I try to have a live disk lying around
for these kinds of quick fixes. :)

So with your live disk, any distro that will give you the passwd utility and
access to your root partition. So guixsd, debian, systemrescuecd, whatever.

1. Boot live disk from usb
2. open terminal and run:
	> passwd $(whoami)
2.1 enter the root passwd you want. Then run:
	> sudo grep $(whoami) /etc/shadow
2.2 You'll get the password as the second field (separated by : the first
	field is the username) e.g.:
	test:$6$jugtjlt6Og/erxFa$FVQR3CNnv9g1aF6nIkGFtdFSeA.uerF4UfM/0/hSMQcz0vDhiV6R4xoX4vQaAHET34expirYLu6OvTbA8/5iM.:17866::::::
2.2 The password, or the password hash is (the password entered here is
	actually "test password"):
	$6$jugtjlt6Og/erxFa$FVQR3CNnv9g1aF6nIkGFtdFSeA.uerF4UfM/0/hSMQcz0vDhiV6R4xoX4vQaAHET34expirYLu6OvTbA8/5iM.
3 Mount your guixsd root partition.
3.1 Open the guixsd-root/etc/shadow in a text editor and change field 2 of
	the line starting with root so it has the password hash you created
	in step 2. In my case I would make it look like:
	root:$6$jugtjlt6Og/erxFa$FVQR3CNnv9g1aF6nIkGFtdFSeA.uerF4UfM/0/hSMQcz0vDhiV6R4xoX4vQaAHET34expirYLu6OvTbA8/5iM.:14403::::::
3.2 Save the guixsd-root/etc/shadow file and reboot. You have now set a new
	password for your root account.

For documentation see
man passwd
man 5 shadow

Now for some this is old, but for those who have not seen this before - this
is why physical access means you own the device. Unless ofcourse, it's
encrypted.


HTH
Tonton

      parent reply	other threads:[~2018-12-01 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 16:02 Single user mode in GuixSD znavko
2018-12-01 13:41 ` Joshua Branson
2018-12-03 10:03   ` Clément Lassieur
2018-12-01 17:13 ` Tonton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181201181321.170f2497@merlin.browniehive.net \
    --to=tonton@riseup.net \
    --cc=help-guix@gnu.org \
    --cc=znavko@tutanota.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.