After "fixing" GRUB, can't login to any user: no shell: permission denied

So this machine is an old one that I just use for whatever, and because of that, it duel boots a copy of Windows 10. And of course that bastard OS likes to update, and today it did one of those “I’m going to remove GRUB so you boot straight to Windows” updates.

So I boot into a live environment, and mess around in a chroot, trying to get GRUB back. And I’m successful! GRUB now appears, the machine is booted, its regular services (including a Minecraft server [lol]) are running.

Except I can’t login. Over SSH, into Cockpit, or from a TTY.

I literally cannot do anything with this install now, except what I can do from a live environment.

When I try to login a message appears for 1-2 60ths of a second (barely managed to video it with my phone), then the TTY refreshes.

The message goes like this:
-- username: no shell: Permission denied

Would specifying a shell for SSH connection help as a first workaround ?

ssh <user>@<ip> -t bash

Another thing I see in other tickets online with the error message as common denominator is that the “permission denied” may mean problems with SELinux labels.
You may try to make a test boot with SELinux disabled via the kernel parameter selinux=0 to verify whether that is the problem.
(you temporarily can edit the GRUB menu entry via slecting it by keyboard arrows, pressing e, edit and then execute the modified version by ctrl+x)

1 Like

Ugh, I forgot about SELinux, that’s probably it honestly. Since I made system modifications from a chroot environment, on an OS that didn’t have SELinux setup in any way, I probably need to “relabel” the whole system or whatever.

Thanks for the pointer, I’ll see how it goes.

Edit: yup, disabling SELinux allowed me to login again…
Now I gotta clean this mess up.