UbuntuServer adds shutdown users

Source: Internet
Author: User
For various reasons, the server is the most broken. In my opinion, we still need to ensure the comfort of developers and improve their work efficiency. As for servers, the current team size and management model do not require good hardware. Hardware Reliability, especially hard disk reliability, can basically meet your needs. Therefore, it is understandable that a M memory celon assumes this responsibility. Because it is a very old computer, the power supply still does not support ACPI. So some time ago, the power button failed to shut down. Because I remember that Windows has a PowerUser group (

For various reasons, the server is the most broken. In my opinion, we still need to ensure the comfort of developers and improve their work efficiency. As for servers, the current team size and management model do not require good hardware. Hardware Reliability, especially hard disk reliability, can basically meet your needs. Therefore, it is understandable that a M memory celon assumes this responsibility.

Because it is a very old computer, the power supply still does not support ACPI. So some time ago, the power button failed to shut down. Because I remember that there is a PowerUser group in Windows (which may be called this name) to complete this action, so I believe that Linux can also complete this function. [6688 e-commerce website www.6688.cc]

Google Keyword: Ubuntu only allows users to shut down. The simplest solution based on relevant articles is to add a common user to the operator group.

1 usermod-G group user

But still prompt... Is not in the sudoers file.

It seems that the final solution is to modify the file/etc/sudoers.

Modification content:
1. Add the following content under # Cmnd alias specification
Cmnd_Alias SHUTDOWN_CMDS =/sbin/poweroff,/sbin/reboot,/sbin/halt
# Shutdown commands that can be executed by users

2. Add the following under # User priviledge specification
Username ALL = (ALL) NOPASSWD: SHUTDOWN_CMDS

In this way, the user can be shut down, but other administrators cannot work.

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.