First of all, this is because the user's permissions are not enough.
Use ls -l /etc/passwd to view all users and permissions. There is only read permission (r), indicating that the user's permission is not enough.
Therefore, we can modify user permissions in the following ways:
1. su root #Enter the super user
2. ll /etc/sudoers #View the permissions of /etc/sudoers
3. chmod 777 /etc/sudoers #Modify the /etc/sudoers file Permissions become readable, writable and executable
4. echo 'username ALL=(ALL) ALL' >> /etc/sudoers # 'username' refers to the user name, give the specified user name permission (or vi this file manually in the line below root Add)
5. chmod 440 /etc/sudoers #Exit and save the /etc/sudoers file
6. su username #Switch the user to the specified user
Finally, when executing various commands such as installation or download, just use sudo to add instructions.
Linux: sudo, no valid sudoers resource found.
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325010361&siteId=291194637
Recommended
Ranking