# Locked Out - Can't LogIn

**URL:** <https://forums.rockylinux.org/t/locked-out-cant-login/17095>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 7, 2025, 3:39pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095 "2025-01-07T15:39:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 7, 2025, 3:39pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/1 "2025-01-07T15:39:36Z")

</div>

I have had the system (9+) live as a Mate Desktop for a few months, after a crash & reboot I am unable to login to the system. On the GUI it goes to login but returns to the login screen, it happens so quickly I do not get a chance to read a displayed message.

I then tried Ctrl+Alt+F2 but the same problem, just returns to login

When I try to ssh into the system I see: client\_loop: send disconnect: Broken pipe

I also have cockpit install and that shows Permission denied, although I do not recall if I had ever used it.

If I type the password wrong, it tells me that it is wrong.

Any ideas? Thanks

---

<div class="post-metadata">

**Author:** ![dali](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dali](https://forums.rockylinux.org/u/dali)\
**Post date:** [January 7, 2025, 7:05pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/2 "2025-01-07T19:05:47Z")

</div>

Corrupt passwd file? Try adding “init=/bin/bash” to the kernel command line and see if /etc/passwd looks broken.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [January 7, 2025, 7:50pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/3 "2025-01-07T19:50:29Z")

</div>

The first thing to look into is where it says “crash and reboot”, understanding what went wrong could provide the answer of how to fix it, e.g. by looking at the logs from the time of the crash, and then looking at the logs from now. Try to access the system by using emergency mode or rescue mode.

---

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 7, 2025, 8:01pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/4 "2025-01-07T20:01:01Z")

</div>

Thanks for your help with this, I have done that and got to the bash prompt, not really sure what I am looking for but the /etc/passwd file is there and looks ok (I think). I opened it up with vi and can see the users

---

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 7, 2025, 8:27pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/5 "2025-01-07T20:27:34Z")

</div>

I tried loging in using single mode editing the Rescue option using single mode, at the prompt to put in the root password it said

sulogin failed to execute /bin/bash Permission denied

sulogin failed to execute /bin/sh Permission denied

I have booted it using a live usb and can access the system that way

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [January 7, 2025, 10:28pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/6 "2025-01-07T22:28:30Z")

</div>

> [@Rascal](#):
>
> I have booted it using a live usb and can access the system that way

So you could look at e.g. ‘/var/log/messages’ from the system that crashed, and see if there are any errors at the time of the crash, and also from the recent single user mode login.

The sulogin failed in single user mode might be to do with selinux needing relabel, it depends on what went wrong in the first place.

---

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 8, 2025, 1:19am UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/7 "2025-01-08T01:19:59Z")

</div>

> [@gerry666uk](#):
>
> So you could look at e.g. ‘/var/log/messages’ from the system that crashed, and see if there are any errors at the time of the crash, and also from the recent single user mode login.
> 
> The sulogin failed in single user mode might be to do with selinux needing relabel, it depends on what went wrong in the first place.

There is mention of selinux but I think it was set to disable, can’t really see much else, have copied the log and can post, where / how would be best?

Thanks

Failed to execute /usr/lib/systemd/systemd: Permission denied  
Failed at step EXEC spawning /usr/lib/systemd/systemd: Permission denied  
Main process exited, code=exited, status=203/EXEC  
Failed with result ‘exit-code’.

Seems to be when I try to login

---

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 8, 2025, 1:48am UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/8 "2025-01-08T01:48:42Z")

</div>

Drama solved!

It was selinux, after posting the above I thought best to check and it was set to

SELINUX=enforcing

Changed to disabled, rebooted and logged in. I guess there may have been some way of fixing it but I have always / usually disabled it, not sure why I had not.

Now I am registered I will keep an eye on the project, switched to Rocky from CentOs about 3 months now and have 2 servers 1x8 & 1x9 + 9 on a desktop.

Thanks all and Happy New Year!

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [January 8, 2025, 7:43am UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/9 "2025-01-08T07:43:08Z")

</div>

Most likely due to selinux extents needed resetting. You would need to put it back to permissive instead of disabled, and then do an autorelabel to fix all the selinux stuff on the files. Then you would be able to log in normally with selinux enabled.

---

<div class="post-metadata">

**Author:** ![Rascal](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rascal](https://forums.rockylinux.org/u/Rascal)\
**Post date:** [January 8, 2025, 12:28pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/10 "2025-01-08T12:28:52Z")

</div>

It is one of those features on Linux that I have always disabled, not sure why I left it this time think I thought I would give it a try, but I have never had a problem by leaving it disabled, one less thing to go wrong.

---

<div class="post-metadata">

**Author:** ![John316](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/john316/32/4991_2.png) [@John316](https://forums.rockylinux.org/u/John316)\
**Post date:** [January 9, 2025, 3:22pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/11 "2025-01-09T15:22:09Z")

</div>

Not running selinux also leaves vulnerabilities open.

As iwalker stated, doing an autorelable will fix most issues unless you have packages that selinux knows nothing about or you have updates beyond the versions handled by the policy installed. Doing an autorelable is one of the first things I do after installing a new version of Linux.

I guess it depends on if your system is on the Internet and can be reached from the outside. I prefer the extra protection rather than run the chance of havoc an intruder could cause.

Selinux can be troublesome until you get used to it.

Setting sebooleans can relax the policy to allow applications to do things not generally allowed. getsebool -a will list all the booleans and whether they are on or off.

The setroubleshoot packages help in debugging selinux issues. You can write your own policy files. Since installing Rocky 9.5, I have written my own modules for Sanp and ZoneMinder since the policy files in the selinux policy have fallen behind what is required for the new versions.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [March 10, 2025, 3:22pm UTC](https://forums.rockylinux.org/t/locked-out-cant-login/17095/12 "2025-03-10T15:22:35Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
