Linux switches the root user, user is not in the sudoers file. This matter will be reported

phenomenon

Failed when switching root user

[test1@xxx /]$ sudo root

我们信任您已经从系统管理员那里了解了日常注意事项。
总结起来无外乎这三点:

    #1) 尊重别人的隐私。
    #2) 输入前要先考虑(后果和风险)。
    #3) 权力越大,责任越大。

[sudo] test1 的密码:
test1 不在 sudoers 文件中。此事将被报告。

the reason

Because the sudo operation of the administrator authority is controlled in the Linux system to prevent general users from sudo operation, it is necessary to manage the administrator authority user, and the administrator authority list is recorded in the sudoers file

Approach

  • Re-use the root user to enter the system
  • Modify sudiers file and add test1 user permissions under root
vim /etc/sudoers

root	ALL=(ALL) 	ALL
test1  ALL=(ALL)   ALL

 

Guess you like

Origin blog.csdn.net/lizz861109/article/details/112509311