You are not logged in.

#1 2020-06-04 19:42:11

thea
Member
Registered: 2006-12-22
Posts: 86

cannot log in, password not recognised

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

#2 2020-06-04 19:55:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: cannot log in, password not recognised

Boot from the live media and chroot in, then set your user's password.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-06-04 19:56:37

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: cannot log in, password not recognised

Just boot from the Installation USB, mount your root filesystem and rename the file from there.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2020-06-04 20:07:31

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

Or just pass "systemd.unit=rescue.target" to the kernel commandline.
Or "init=/bin/bash".

Offline

#5 2020-06-04 22:54:43

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#6 2020-06-04 23:05:11

loqs
Member
Registered: 2014-03-06
Posts: 17,560

Re: cannot log in, password not recognised

Can you select booting from the installation media using the firmwares boot menu?  The media needs to be connected when the system boots.

Offline

#7 2020-06-05 07:25:00

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#8 2020-06-05 07:27:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: cannot log in, password not recognised

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)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2020-06-05 08:45:53

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#10 2020-06-05 08:52:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,885

Re: cannot log in, password not recognised

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

#11 2020-06-05 10:29:34

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#12 2020-06-05 11:21:10

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

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

#13 2020-06-05 14:41:06

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

I followed these steps:

mount /dev/nvme0n1p2 /mnt
passwd --root /mnt thea
passwd: Cannot determine your user name.

Offline

#14 2020-06-05 14:44:38

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

cat /mnt/etc/passwd
grep thea /mnt/etc/passwd

Offline

#15 2020-06-05 14:56:42

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#16 2020-06-05 15:01:33

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,636

Re: cannot log in, password not recognised

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

#17 2020-06-05 15:03:09

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

cat /mnt/etc/passwd -- no such file

Most likely means that you failed to mount the root partition.

Offline

#18 2020-06-05 15:11:22

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

when I try again:
mount /dev/nvme0n1p2 /mnt

I get the message:
mount: /mnt: /dev/nvme0n1p2 already mounted on /mnt.

Offline

#19 2020-06-05 15:11:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,636

Re: cannot log in, password not recognised

And what's there?

Offline

#20 2020-06-05 15:16:05

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

cd /mnt
ls

casper-B323-B057 dists pool recovery.conf

Offline

#21 2020-06-05 15:17:10

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

Well, that's not the root partition.
"lsblk -f"?

Offline

#22 2020-06-05 15:26:45

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

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

#23 2020-06-05 15:27:27

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: cannot log in, password not recognised

Yup.

Offline

#24 2020-06-05 15:35:07

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

I mounted p3, and set the password for root. This password is still not recognised when I try to login normally.

Offline

#25 2020-06-05 15:59:40

thea
Member
Registered: 2006-12-22
Posts: 86

Re: cannot log in, password not recognised

[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

Board footer

Powered by FluxBB