Linux under sudo command

Source: Internet
Author: User

 from The local systemadministrator. It usually boils down to these three things:    #1) Respect the privacy of others.    #2) Think before you type.    #3for isn't in thesudoers file.  This incident would be reported.

Linux By default does not open sudo permissions for the current user (except root)!

One: Enter the Super User
[email protected] root]$ Su-
Two: Start editing and editing /etc/sudoersFile
[Email protected] etc]# Ls-al | grep sudo -r--r-----.   1 root root   4002 Mar  2     sudoers #对其进行操作drwxr-x---.   2 root root   4096    sudoers.d-r--r-----.   1 root root   1031   sudo-ldap.conf
(1) Force write (or give permission first, then remove permission)
[Email protected] etc]# vim sudoers
(2) Find root all= (all) All this line, add the Run sudo permission below for the required user
Root    all=(All)       Alluserld  all = (all) all       #默认是需要去输入userld用户的密码, when Sudo is executed
Userld all= (All) Nopasswd:all #是不需要去输入密码的
(3) The user group can also be operated, consistent with the above
% User Group  all=(All) all       #默认是需要去输入userld用户的密码, when Sudo is executed% user Group  all = (All)       Nopasswd:all # There's no need to enter a password.
Three: Testing
[[email protected] root]$ ls #默认是不允许去操作root目录的, permission not allowed  New  in/var/spool/mail/root[[email protected] root]$ lsls:cannot Open Directory.: Permission denied[ [email protected] root]$ sudo ls #使用sudo执行, user ordinary user to perform some or all of the administrator commands Anaconda-ks.cfg  Documents    Install.log.syslog  public     videosapplication      Downloads    Music               templatesdesktop          Install.log  Pictures            test

Linux under sudo command

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.