简体   繁体   中英

How to stop Centos 7 Desktop returning to Login Screen after a successful login?

So I just did a fresh install of Centos 7 with the desktop. After the install, I installed my development environment and when to attach my windows ssd, but was told it needed to be shutdown instead of hibernation. So I restarted my system, booted into windows, and hit shutdown. Afterwards, I went to login into my Centos 7 System, and after a successful password entry, it'll start the login process, and then flash a black screen. Soon it'll show Started virtualization daemon, and then load the login screen again!

Why is it doing this? How can I fix it? Then how can I avoid this in the future??

Thanks for your help!

Interrupt the boot at the GRUB stage and boot to runlevel 1, AKA single user mode. Interrupt GRUB by typing a character such as "space" then append to the kernel line by typing "a", backspacing through "rhgb quiet" and appending " 1". This will give you a root shell and not a login prompt. From there you can comment all recent entries in /etc/environment , and reboot your server/PC

I faced the same problem on Centos 6.7 after the yum update and fix with the below steps.

I noticed some commands not working on the terminal, which can be opened via CTRL+ALT+F4 on the login screen.

-bash: startx: command not found

I have opened a file under /etc/profile.d with root privileges.

nano /etc/profile.d/fix.sh

and added command to set missing definitions to PATH

export PATH=$PATH:/bin:/usr/local/bin:/usr/bin

After restarting the OS, everything works fine.

My OS RedHat Enterprise Linux 7.4

After a yum update to Redhat 7.5, which includes kernel upgrade and a whole bunch of other updates, RedHat 7.5 wouldn't login and bounce/redirect back to login GUI/screen.

Here's what worked for me:

  1. CTRL + ALT + F2
  2. Elevate to sudo or root
  3. chown -R ram:ram /home/ram # <- Change $HOME directory ownership recursively for problematic user. Use user:group combination relevant for you
  4. CTRL + ALT + F1 and try login again. I was able to login.

Solution:2 If above doesn't work for you, you could also undo last yum update .

yum history list
yum history info id_number
yum history undo id_number

and then reboot.

If you can't even get a prompt with key combination CTRL + ALT + F2 ,boot into single user mode and try Solution:2

This should work for CentOS & Fedora as well.

I ended up reinstalling the os. However, I ended up getting the same issue. It was a two part error. So adding anything to my /etc/environment file caused the system not to login. Also, after you install, you need to sudo /etc/passwd because the gnome-init-shell and gdm need to have :/sbin/nologin removed. It's kind of stupid that we have to do that extra step. Now if you were like me, installed everything and dread the reinstall, you can place in the boot disk/usb and go to recovery mode. It'll show you how to get to your system and from there, its just using vi to fix the passwd.

I came across this issue via a search. Turns out CentOS may not like usernames with periods in them. When I logged into shell, it said /home/first.last does not exist. For reference, I was installing this: http://central-7-0-x86-64.rocksclusters.org/roll-documentation/base/7.0/install-frontend-7.html

you can refer my solution, because i use mv command to rename my name dir,causing a login infinite loop. when i again use mv command to recover my name dir

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM