How does one set the Linux operating system to log on as a root user?

Source: Internet
Author: User

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.