Home > OS >  When Linux to obtain root access problems
When Linux to obtain root access problems

Time:09-17

Input the su -
Su: Authentication failure

Enter sudo passwd root
There is not in the sudoers file. This incident will be reported

Read online, to solve the second problem, the root, the first step is to enter the super users, can be I am in the process of root,
And then into the infinite loop, has been won't solve

Just learning Linux doesn't understand,

CodePudding user response:

Linux "XXX is not in the sudoers file" solution
Users do not have permissions to sudo, the solution is as follows:

Switch to the super user su
Open the/etc/sudoers file vi/etc/sudoers
Modify files in the root ALL=(ALL) ALL the next row add content ALL=XXX (ALL) ALL keep out,
Switch back to the original user, using sudo,

But I can't enter the super users do

CodePudding user response:

The su command to switch to the super family
Linux users devolution of power (sudo) tutorial reference blog
https://blog.csdn.net/chaos_oper/article/details/103870757

CodePudding user response:

Common three Linux users:
1. The root super user
2. The administrator user (generally need to use the su, sudo command to switch to the super user)
3. Ordinary users, the inability to use the su, sudo command in to super user, equivalent to a guest user in Windows)
There is a line in centos/etc/sudoers: % wheel ALL=(ALL) ALL
% wheel said wheel administrators group, other Linux versions may not be the same, or a % sudo, or % admin, or the other, or no, said the user in the administrators group can hint to the super user, of course you can also build an administrator group and add: ALL=% XXX (ALL) ALL, also can not build directly add users as administrator: yyy ALL=(ALL),
modify the/etc/sudoers file, of course, need to switch the super user or itself is the root user,
you described in your account for ordinary users, so you have to use the root account to log in to the account rights,
The current account to the administrator account (input root account password) : su root - c 'echo "$USER ALL=(ALL) ALL" & gt;> The/etc/sudoers'
  • Related