What should I do if a Linux normal user does not have permission to use the command?

  

Many users encounter problems with normal user permissions when performing Linux system operations, resulting in some system commands not being able to be used, such as reboot, shutdown, etc., it is not difficult to solve this problem, the following small series I will introduce you to the solution that Linux ordinary users do not have permission to use system commands.

Solution:

Here is necessary to use the special permissions linux command: Fu plus suid privileges.

For example, if you log in to the normal user user1 and want to use the reboot command, you will be prompted to run this command.

But if you modify the permissions of the configuration file of this command, you can log in to the normal user to use this command.

First use the root user to log in to the system;

Then type "&"quo reboot”, you will get the absolute path of the reboot configuration file /sbin/reboot

and then add it to /sbin/reboot file permissions S,

chmod 4744 /sbin/reboot

Then switch to user1:su - user1

After you type reboot again, you can execute this command. .

The above is a description of the way Linux common users use system commands. When you encounter such problems, you need to use the permission command suid to modify the permissions of ordinary users.

Copyright © Windows knowledge All Rights Reserved