You are not logged in.
First off, this is my mistake. I was just out of the hospital, and tired. Shadow was updated, and I simply replaced the former shadow file with the new (pacnew). Rebooted and of course no passwords, so I can't log in, no root either, of course. All I need to do is to rename the old shadow file (now shadow.old), but how to do this? Because I cannot log in, I can't mount a rescue disk. I have access to the grub shell, but I don't know if that could help. Thanks in advance for any useful tips.
Offline
Boot from the live media and chroot in, then set your user's password.
Offline
Just boot from the Installation USB, mount your root filesystem and rename the file from there.
Offline
Or just pass "systemd.unit=rescue.target" to the kernel commandline.
Or "init=/bin/bash".
Offline
Thanks for the tips! Unfortunately, I can't mount the installation USB, since I can't login, it isn't automatically detected. And the only utility I seem to have is the grub shell.
What exactly is the root password in shadow.pacnew?
Offline
Can you select booting from the installation media using the firmwares boot menu? The media needs to be connected when the system boots.
Offline
OK, thanks, I had forgotten about setting the boot order. So now the installation disk is booted and I have a root@archiso prompt. cd /etc and ls show:
shadow
shadow-
They both appear to be the same.
I have read a bit about editing the shadow file, and about using vipw, which is totally unfamiliar to me. Obviously I am not wanting to make further mistakes here. What should I do now?
Offline
Don't edit the file by hand. Use passwd to create a new password for your user.
# edit: from the chroot.
Last edited by jasonwryan (2020-06-05 07:27:51)
Offline
I tried setting the password, but it failed. I have read the Arch instructions on resetting a lost root password.
In particular:
at prompt root@archiso:
mount /dev/sda1 /mnt
passwd --root /dev/sda1 thea
passwd: cannot chdir to chroot directory /dev/sda1: Not a directory
Offline
Your chroot directory to pass to that command would be /mnt not /dev/sda... or just actually chroot into it with arch-chroot and run passwd normally.
Offline
Thanks V1del! I have a feeling that am working on the wrong filesystem. Here are the results of lsblk:
loop0 /run/archiso/sfs/airootfs
sda disk
sda1 part
sdb disk
sdb1 part /run/archiso/bootmnt
nve0n1 disk
nve0n1p1 part
nve0n1p2 part
nve0n1p3 part
nve0n1p4 part
the boot partition is on nve0n1. sda is a separate (second) hard drive. sdb is an installation USB.
My understanding is that I have to mount the boot file syste. How do I do this?
Offline
You want to mount the root partition, not the boot partition (the one that holds "/", not "/boot") and you do that by simply creating a mountpoint (eg. /mnt) and mounting it there:
mount /dev/nve0n1p2 /mnt
However and again: you can tell the system to boot a root shell, no password required. See comment #4 and also https://wiki.archlinux.org/index.php/Re … t_password
Offline
I followed these steps:
mount /dev/nvme0n1p2 /mnt
passwd --root /mnt thea
passwd: Cannot determine your user name.
Offline
cat /mnt/etc/passwd
grep thea /mnt/etc/passwd
Offline
cat /mnt/etc/passwd -- no such file
however
cd /mnt
cd /etc
nano passwd
works.
There is no user thea, but there is root:
root:x:0:0::/root:/usr/bin/zsh
Offline
you cd'ed to /etc on the ISO, what did you expect? Notice that's a full path, not a relative one.
Last edited by Scimmia (2020-06-05 15:02:55)
Offline
cat /mnt/etc/passwd -- no such file
Most likely means that you failed to mount the root partition.
Offline
when I try again:
mount /dev/nvme0n1p2 /mnt
I get the message:
mount: /mnt: /dev/nvme0n1p2 already mounted on /mnt.
Offline
And what's there?
Offline
cd /mnt
ls
casper-B323-B057 dists pool recovery.conf
Offline
Well, that's not the root partition.
"lsblk -f"?
Offline
It's arch, no doubt about that.
here are results of lsblk -f, just for the main drive:
nvme0n1
p1 vfat EFI
p2 vfat RECOVERY /mnt
p3 ext4
p4 swap
I believe the root partition is p3. Does that make sense?
Offline
Yup.
Offline
I mounted p3, and set the password for root. This password is still not recognised when I try to login normally.
Offline
[SOLVED] After identifying the root partition, I chrooted into this partition and used passwd to change the passwords. This was successful and I am now able to login normally. Many thanks to those who assisted me!
Last edited by thea (2020-06-05 16:01:52)
Offline