all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Single user mode in GuixSD
@ 2018-11-30 16:02 znavko
  2018-12-01 13:41 ` Joshua Branson
  2018-12-01 17:13 ` Tonton
  0 siblings, 2 replies; 4+ messages in thread
From: znavko @ 2018-11-30 16:02 UTC (permalink / raw)
  To: Help Guix

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

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

I've tried to press 'e' in GRUB, added init=/bin/sh and booted into it.

But login screen appeared, if it was the usual boot. And I need to use usb-stick, mount file system, delay root hash from /etc/shadow.

Please, how to get single-user mode in GuixSD?

[-- Attachment #2: Type: text/html, Size: 803 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Single user mode in GuixSD
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Joshua Branson @ 2018-12-01 13:41 UTC (permalink / raw)
  To: help-guix

<znavko@tutanota.com> writes:

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

If you've lost the root password, I don't believe there is much that we
can do.  You might just have to reinstall.  :()

> I've tried to press 'e' in GRUB, added init=/bin/sh and booted into it.
>
> But login screen appeared, if it was the usual boot. And I need to use usb-stick, mount file system, delay root hash from /etc/shadow.
>
> Please, how to get single-user mode in GuixSD?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Single user mode in GuixSD
  2018-11-30 16:02 Single user mode in GuixSD znavko
  2018-12-01 13:41 ` Joshua Branson
@ 2018-12-01 17:13 ` Tonton
  1 sibling, 0 replies; 4+ messages in thread
From: Tonton @ 2018-12-01 17:13 UTC (permalink / raw)
  To: znavko; +Cc: Help Guix

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Single user mode in GuixSD
  2018-12-01 13:41 ` Joshua Branson
@ 2018-12-03 10:03   ` Clément Lassieur
  0 siblings, 0 replies; 4+ messages in thread
From: Clément Lassieur @ 2018-12-03 10:03 UTC (permalink / raw)
  To: Joshua Branson; +Cc: help-guix

Joshua Branson <jbranso@fastmail.com> writes:

> <znavko@tutanota.com> writes:
>
>> Hello, Guix Help! Once I've lost root password and need to restore root password in GuixSD.
>>
>
> If you've lost the root password, I don't believe there is much that we
> can do.  You might just have to reinstall.  :()

No, if you have physical access, you can read and modify everything on
your data storage device if you boot from another distro and thus use
the data storage device as an external device.  :-)

>> I've tried to press 'e' in GRUB, added init=/bin/sh and booted into it.
>>
>> But login screen appeared, if it was the usual boot. And I need to use usb-stick, mount file system, delay root hash from /etc/shadow.
>>
>> Please, how to get single-user mode in GuixSD?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-03 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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.