Home > Operation and Maintenance > CentOS > What should I do if I cannot log in despite my correct password in centos7?

What should I do if I cannot log in despite my correct password in centos7?

王林
Release: 2020-06-20 13:17:58
Original
17512 people have browsed it

What should I do if I cannot log in despite my correct password in centos7?

In the startup grub interface, press the up and down keys to select the Linux normal system, press the e key to enter the code editing interface;

Edit the linux16 line and change ro to rw init=/sysroot/bin/sh;

(Recommended tutorial: centos tutorial)

Temporarily change the startup code, boot without mounting the disk, and enter the shell directly: sh ;

Press the ctrl Find the relevant error message:

chroot /sysroot       #切换根目录
Copy after login

Open the file and remove the problematic module

vi /var/log/secure   #查看日志文件
Copy after login

Comment out the problematic module:

Jan  18 12:10:17 sguap0010 login: PAM adding faulty module: /lib/security/pam_limits.so
Jan  18 12:10:20 sguap0010 login: pam_unix(login:session): session opened for user root by LOGIN (uid=0)
Jan  18 12:10:21 sguap0010 login: Module is unknown
Copy after login

or

vi /etc/pam.d/login
Copy after login
Copy after login

exit --- Exit bash and return to sh

reboot --- Restart

After entering the system, download the pam_limits.so module file and overwrite /lib/security/pam_limits.so

(64-bit operating system, overwrite /lib64/security/pam_limits.so)

Then

#session required /lib/security/pam_limits.so
Copy after login

uncomment what you just commented out

#session include system-auth
Copy after login

or

vi /etc/pam.d/login
Copy after login
Copy after login

That’s it.

The above is the detailed content of What should I do if I cannot log in despite my correct password in centos7?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template