The solution for ordinary users not being able to use the sudo command

The solution for ordinary users not being able to use the sudo command

https://www.cnblogs.com/fasthorse/p/5949946.html

 

 

1. Switch to the root user: su – root

2. Add write permission to the /etc/sudoers file: chmod u+w /etc/sudoers

3. Add permission to use sudu to ordinary users:

vim /etc/sudoers

Find this line: root ALL=(ALL) ALL, add xxx ALL=(ALL) ALL below this line (xxx here is your normal user)

##Explain here, add the format of the sudo command that ordinary users can use under sudoers:

xxx ALL=(ALL) ALL ##: Ordinary users can use the sudo command, but a password is required

%xxx ALL=(ALL) ALL ##Users in user group xxx can use the sudo command, but a password is required

xxx ALL=(ALL) NOPASSWD:ALL ##Ordinary users can use sudo command without password

%xxx ALL=(ALL) NOPASSWD:ALL ##Users in user group xxx can use sudo command without password

4. After adding, save and exit

5. Remove the root user's write permission to the sudoers file: chmod uw /etc/sudoers

 



 

解决sudo: sorry, you must have a tty to run sudo

https://blog.csdn.net/breezehappy/article/details/38895375

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325855142&siteId=291194637