General CentOS users add sudo permissions

Source: Internet
Author: User
Environment for adding sudo permissions to CentOS common users: CentOS operations under VMware: [kiwi @ localhost ~] $ Sudoapt-getinstallsamba & lt; ----- normal user kiwi needs to perform sudo operation [sudo] passwordforshaokn: & lt; ----- inputpa... environment for adding sudo permissions to CentOS common users: CentOS operations under VMware: [kiwi @ localhost ~] $ Sudo apt-get install samba <----- normal user kiwi needs to perform sudo operation [sudo] password for shaokn: <----- input passwdkiwi is not in the sudoers file. this incident will be reported. the user is prompted that the shaokn is not in the sudoers file. what we need to do is add kiwi users to the sudoers file. how can this problem be solved? 1. enter super user mode. [kiwi @ localhost ~] $ Su-Password: <----- input passwd [root @ localhost ~] # <----- Root Super User 2. add sudoers file write permission. [root @ localhost ~] # Chmod u + w/etc/sudoers <----- note sudoers file path 3. add kiwi to the sudoers file. add "kiwi ALL = (ALL) ALL" in the "root ALL = (ALL) ALL" line ". [root @ localhost ~] # Vim/etc/sudoers .................................. ................ root ALL = (ALL) ALLkiwi ALL = (ALL) ALL <----- add here.: wq save and exit ..................................... ............. 4. revoke sudoers write permission. remember to revoke the write permission. [root @ localhost ~] # Chmod u-w/etc/sudoers: In the following four steps, the kiwi user is successfully added to the sudoers file. kiwi also has the sudo permission.
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.