For some new Linux operating systems, users are generally not allowed to log on as root users, and many permissions are not available (such as creating folders), which makes the development of Linux impossible.
Below I will summarize my solutions to this problem as follows:
(1) first, log on to Linux (of course, a common user );
(2) switch to the root account: su root;
(3) CD/etc/PAM. d
(4) VI TPD
Change the originalCodeMake the following changes:
# % PAM-1.0
Auth [success = Done ignore = ignore default = bad] pam_selinux_permit.so
# Auth required pam_succeed_if.so user! = Root quiet (comment out the line, and leave the rest unchanged)
Auth required pam_env.so
Auth substack system-auth
Auth optional pam_gnome_keyring.so
Account required pam_nologin.so
Account include system-auth
Password include system-auth
Session required pam_selinux.so close
Session required pam_loginuid.so
Session Optional pam_lele.so
Session required pam_selinux.so open
Session Optional pam_keyinit.so force revoke
Session required pam_namespace.so
Session Optional pam_gnome_keyring.so auto_start
Session include system-auth
(5) Save and exit;
(6) vi tpd-Password (some can be omitted if none exist)
Make the following changes to the original code:
Auth [success = Done ignore = ignore default = bad] pam_selinux_permit.so
Auth substack password-auth
# Auth required pam_succeed_if.so user! = Root quiet (comment out the line, and leave the rest unchanged)
Auth optional pam_gnome_keyring.so
Account required pam_nologin.so
Account include password-auth
Password include password-auth
Session required pam_selinux.so close
Session required pam_loginuid.so
Session Optional pam_lele.so
Session required pam_selinux.so open
Session Optional pam_keyinit.so force revoke
Session required pam_namespace.so
Session Optional pam_gnome_keyring.so auto_start
Session include password-auth
(7) Save and exit;
(8) log out, log on again, and solve the problem.