Centos user permission modification

Source: Internet
Author: User
I. The reason for the problem is that the centos6.5 system is installed today, which is a graphical interface for installation. But I don't want to reinstall the mini version. All are ready to modify system problems, so that the system automatically enters the command mode when it is started. 2. the error message is that a common user is logged on. modify the/etc/inittab file. & n

I. causes of problems

The centos6.5 system is installed today. But I don't want to reinstall the mini version. All are ready to modify system problems, so that the system automatically enters the command mode when it is started.

II. error message

Log on to a common user and modify the/etc/inittab file.

The last row defaults:

Id: 5: initdefault: # enter the image interface by default

You only need to change 5 to 3, and then the password-line mode is automatically started.

However, the following message is displayed when you save the modification:

Xxx is not in the sudoers file. This incident will be reported.

III. Solution

Modify the/etc/sudoers file. Normal users cannot modify this file and need to switch to the root user.

1. the/etc/sudoers file is a read-only file. you need to modify the file permission attribute first.

Chmod u + w/etc/sudoers

2. find vim/etc/sudoers and find the following information:

# Allow root to run any commands anywhere

Root ALL = (ALL) ALL

Add a row under root, with leo serving as your username. After modifying the wq file, save and exit.

Leo ALL = (ALL) ALL

3. cancel write permission after modification

Chmod u-w/etc/sudoers

4. after modification, you can use su-to obtain the root permission (su username # switch users)

Related Article

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.