Solution for Linux users who cannot call system commands

Source: Internet
Author: User

In Linux, I was asked how common user user1 could not use commands such as reboot and shutdown.

In fact, this problem is very simple and well solved.

Here we need to use the special permission command of linux: grant of suid permission.

For example, if you log on to user1 as a common user and want to use the reboot command, you will be prompted that you do not have the permission to execute this command.

However, if you modify the permission of the configuration file of this command, you can log on to the common user to use this command.

First, log on to the system as the root user;

Then, press "which reboot" to obtain the absolute path of the reboot configuration file/sbin/reboot.

Then grant the/sbin/reboot File Permission S,

Chmod 4744/sbin/reboot

Switch to user1: su-user1

Run the reboot command again.

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.