Detailed sudo permissions for Linux

>>> Linux tutorial directory <<<

Permission management-4.1 system command sudo permissions

Write in the front: If you finish the inspection by yourself, there may be some mistakes. If you find something wrong, you can leave a message or private message me below.

1. sudo permissions

  • root it should only be executed by the super user to give ordinary users to execute
  • sudo operates on system commands

2. Use sudo

  • visudo command
    • In fact, the / etc / sudoers file is modified. It is also possible to modify this file directly with vi without the above command
  • root ALL=(ALL) ALL
    • [User name] [address of managed host] = [(available identity)] [authorization command]
    • The authorize command must write the absolute path
  • %wheel ALL=(ALL) ALL
    • % Group name [address of managed host] = [(available identity)] [authorization command]

3. Authorize zxx users to restart the server

  • visudo
  • Write the following:
    • zxx ALL=/sbin/shutdown -r now

4. Ordinary users execute commands given by sudo

  • sudo -l
    • View available sudo commands
  • sudo /sbin/shutdown -r now
    • Ordinary users execute commands given by sudo
  • Note: vim must not be given to ordinary users, otherwise any file can be modified

Write in the back: I hope these explanations will be helpful to you, I hope everyone will like and pay attention to it. Your support is my biggest motivation (๑> ؂ <๑)

Published 366 original articles · praised 68 · 50,000+ views

Guess you like

Origin blog.csdn.net/qq_43479432/article/details/105635843