Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Rocky (RHEL clone) can't log/chroot in

13 views
Skip to first unread message

David Chmelik

unread,
Jan 1, 2024, 8:14:01 PM1/1/24
to
I started with *BSD UNIX and Slackware GNU/Linux in 1997 but tried RedHat
GNU/Linux that year and roughly in the '0s. Recently I installed Rocky
GNU/Linux (considered successor of CentOS GNU/Linux) and tried to chroot
in from Slackware but got the following
error message.

chroot: failed to run command ‘/bin/bash’: Permission denied

Someone on libera Internet Relay Chat (IRC) #rocky said boot it with
selinux=disabled, which I did (I entered GRUB2 menu and put that parameter
after a space at end of line that said linux). When I rebooted to
Slackware, nothing had changed (same error message chrooting in).
A weird thing happened when I actually booted Rocky: when I typed my
username into the login prompt it had a few <TABs> or many spaces
afterwards and looked sort of like the following (after typing username).

login: root

Then it was unable to login with the password I had set. Looks like
something went wrong with I/O, though all other (over 10) OS (mostly UNIX/
GNU/Linux) on my PC don't have this problem. Of course, I also had a
user/wheel account but didn't try that yet--do I need to do this to
activate 'selinux=disabled'? I hope RedHat hasn't--on enterprise GNU/
Linux also used as servers--disabled root login, which traditional system
administrators (sysadmins) since UNIX days tend to use rather than just
'sudo'/'doas'.

Marco Moock

unread,
Jan 2, 2024, 2:56:26 AM1/2/24
to
Am 02.01.2024 um 01:13:59 Uhr schrieb David Chmelik:

> I started with *BSD UNIX and Slackware GNU/Linux in 1997 but tried
> RedHat GNU/Linux that year and roughly in the '0s. Recently I
> installed Rocky GNU/Linux (considered successor of CentOS GNU/Linux)
> and tried to chroot in from Slackware but got the following
> error message.
>
> chroot: failed to run command ‘/bin/bash’: Permission denied

Is that file allowed to be executed (x in ls) by the user of the system
you currently use?

> Someone on libera Internet Relay Chat (IRC) #rocky said boot it with
> selinux=disabled, which I did (I entered GRUB2 menu and put that
> parameter after a space at end of line that said linux). When I
> rebooted to Slackware, nothing had changed (same error message
> chrooting in). A weird thing happened when I actually booted Rocky:
> when I typed my username into the login prompt it had a few <TABs> or
> many spaces afterwards and looked sort of like the following (after
> typing username).
>
> login: root
>
> Then it was unable to login with the password I had set. Looks like
> something went wrong with I/O, though all other (over 10) OS (mostly
> UNIX/ GNU/Linux) on my PC don't have this problem.

VirtualBox?

> Of course, I also
> had a user/wheel account but didn't try that yet--do I need to do
> this to activate 'selinux=disabled'? I hope RedHat hasn't--on
> enterprise GNU/ Linux also used as servers--disabled root login,
> which traditional system administrators (sysadmins) since UNIX days
> tend to use rather than just 'sudo'/'doas'.

You can activate it by simply setting a password for it. For SSH, you
also just need to change the line PermitRootLogin.

David Chmelik

unread,
Jan 7, 2024, 12:13:37 AM1/7/24
to
On Tue, 2 Jan 2024 01:13:59 -0000 (UTC), David Chmelik wrote:

> I started with *BSD UNIX and Slackware GNU/Linux in 1997 but tried
> RedHat GNU/Linux that year and roughly in the '0s. Recently I installed
> Rocky GNU/Linux (considered successor of CentOS GNU/Linux) and tried to
> chroot in from Slackware but got the following error message.
>
> chroot: failed to run command ‘/bin/bash’: Permission denied
>
> Someone on libera Internet Relay Chat (IRC) #rocky said boot it with
> selinux=disabled, which I did (I entered GRUB2 menu and put that
> parameter after a space at end of line that said linux). When I
> rebooted to Slackware, nothing had changed (same error message chrooting
> in).

Fixed this with the following

mount -o bind /dev /redhat/dev
mount -o bind /proc /redhat/proc
mount -o bind /sys /redhat/sys
mount -o remount,dev,exec /redhat

Still don't know if I can boot then login but will try soon.

David Chmelik

unread,
Jan 7, 2024, 10:34:11 PM1/7/24
to
On Sun, 7 Jan 2024 05:13:35 -0000 (UTC), David Chmelik wrote:
> On Tue, 2 Jan 2024 01:13:59 -0000 (UTC), David Chmelik wrote:
> [finally was able to chroot]
>> A weird thing happened when I actually booted Rocky: when I typed
>> my
>> username into the login prompt it had a few <TABs> or many spaces
>> afterwards and looked sort of like the following (after typing
>> username).
>>
>> login: root
>>
>> Then it was unable to login with the password I had set. Looks like
>> something went wrong with I/O, though all other (over 10) OS (mostly
>> UNIX/
>> GNU/Linux) on my PC don't have this problem. Of course, I also had a
>> user/wheel account but didn't try that yet--do I need to do this to
>> activate 'selinux=disabled'? I hope RedHat hasn't--on enterprise GNU/
>> Linux also used as servers--disabled root login, which traditional
>> system administrators (sysadmins) since UNIX days tend to use rather
>> than just 'sudo'/'doas'.

Here's what the broken login screen looks like (always four spaces after
prompt): http://imgur.com/a/zKXxEOx . It always says correct passwords
are wrong, even blank ones. Before I deleted those (in chroot, then
booted to Rocky) for the wheel user it had a large message saying
something about a wrong context (not bad password, but still didn't accept
it).

Marco Moock

unread,
Jan 8, 2024, 4:49:21 AM1/8/24
to
Am 08.01.2024 um 03:34:09 Uhr schrieb David Chmelik:

> Here's what the broken login screen looks like (always four spaces
> after prompt): http://imgur.com/a/zKXxEOx . It always says correct
> passwords are wrong, even blank ones. Before I deleted those (in
> chroot, then booted to Rocky) for the wheel user it had a large
> message saying something about a wrong context (not bad password, but
> still didn't accept it).

blank ones are treated like wrong, IIRC.

Can you boot in live system again, then chroot and then run passwd to
set the passwords?

Does the content of /etc/shadow change?

David Chmelik

unread,
Jan 9, 2024, 11:20:01 PM1/9/24
to
On Mon, 8 Jan 2024 10:49:18 +0100, Marco Moock wrote:

> Am 08.01.2024 um 03:34:09 Uhr schrieb David Chmelik:
>
>> Here's what the broken login screen looks like (always four spaces
>> after prompt): http://imgur.com/a/zKXxEOx . It always says correct
>> passwords are wrong, even blank ones. Before I deleted those (in
>> chroot, then booted to Rocky) for the wheel user it had a large message
>> saying something about a wrong context (not bad password, but still
>> didn't accept it).
>
> blank ones are treated like wrong, IIRC.

I've seen articles that say otherwise, and tried it with correct non-blank
passwords 10+ times with behaviour described.

David Chmelik

unread,
Jan 11, 2024, 6:08:01 AM1/11/24
to
On Mon, 8 Jan 2024 10:49:18 +0100, Marco Moock wrote:

> Am 08.01.2024 um 03:34:09 Uhr schrieb David Chmelik:
>
>> Here's what the broken login screen looks like (always four spaces
>> after prompt): http://imgur.com/a/zKXxEOx . It always says correct
>> passwords are wrong, even blank ones. Before I deleted those (in
>> chroot, then booted to Rocky) for the wheel user it had a large message
>> saying something about a wrong context (not bad password, but still
>> didn't accept it).
>
> blank ones are treated like wrong, IIRC.

I've seen articles that say otherwise, but found what the problem is.
Rocky doesn't prompt (and wait for input) to ask if I want a boot-loader
and overwrites/clobbers the one I have. When I booted with Rocky's GRUB2,
I was able to login. Of course then I rebooted and overwrote that with my
original from Slackware, then later tried to boot Rocky. That's when I
saw the same broken login prompt.
Apparently Rocky leaves no configuration details in a place other GNU/
Linux can find and configure it to boot right. It apparently uses a
special type of booting not just with several kernel parameters but maybe
other stuff that's obscured in some configuration detail/file I haven't
found. I need to transfer over this configuration, but it'd be best if it
can just be better in the future to be detected automatically just as
Debian/Devuan/Ubuntu/Mint/Neon, Gentoo, Arch all get their GRUB2
configuration detected to be configured to boot fine. RedHat is almost as
old as Debian so I don't know why something this basic is broken on it...
of course Debian/Devuan has broken things also. The only most reliable
GNU/Linux is Slackware!

David Chmelik

unread,
Jan 25, 2024, 11:22:17 PM1/25/24
to
On Tue, 2 Jan 2024 08:56:24 +0100, Marco Moock wrote:

> Am 02.01.2024 um 01:13:59 Uhr schrieb David Chmelik:
>
>> I started with *BSD UNIX and Slackware GNU/Linux in 1997 but tried
>> RedHat GNU/Linux that year and roughly in the '0s. Recently I
>> installed Rocky GNU/Linux (considered successor of CentOS GNU/Linux)
>> and tried to chroot in from Slackware but got the following error
>> message.
>>
>> chroot: failed to run command ‘/bin/bash’: Permission denied
>
> Is that file allowed to be executed (x in ls) by the user of the system
> you currently use?

OF course!

>> Someone on libera Internet Relay Chat (IRC) #rocky said boot it with
>> selinux=disabled, which I did (I entered GRUB2 menu and put that
>> parameter after a space at end of line that said linux). When I
>> rebooted to Slackware, nothing had changed (same error message
>> chrooting in). A weird thing happened when I actually booted Rocky:
>> when I typed my username into the login prompt it had a few <TABs> or
>> many spaces afterwards and looked sort of like the following (after
>> typing username).
>>
>> login: root
>>
>> Then it was unable to login with the password I had set. Looks like
>> something went wrong with I/O, though all other (over 10) OS (mostly
>> UNIX/ GNU/Linux) on my PC don't have this problem.
>
> VirtualBox?

no

William Unruh

unread,
Jan 26, 2024, 12:13:55 AM1/26/24
to
On 2024-01-26, David Chmelik <dchm...@gmail.com> wrote:
> On Tue, 2 Jan 2024 08:56:24 +0100, Marco Moock wrote:
>
>> Am 02.01.2024 um 01:13:59 Uhr schrieb David Chmelik:
>>
>>> I started with *BSD UNIX and Slackware GNU/Linux in 1997 but tried
>>> RedHat GNU/Linux that year and roughly in the '0s. Recently I
>>> installed Rocky GNU/Linux (considered successor of CentOS GNU/Linux)
>>> and tried to chroot in from Slackware but got the following error
>>> message.
>>>
>>> chroot: failed to run command ‘/bin/bash’: Permission denied

You need to make sure that your chroot actually contains bash and that
it is executable by whatever user you are trying to run as. Remember
your chroot needs to be able to access a version of /etc/passwd, and
/usr/bin so it can find the programs, etc. It sounds to me like your
chrooted system has permission problems.
Which is what the sentence is trying say.
0 new messages