Пользователь не находится в файле sudoers. Об инциденте будет сообщено [дубликат]

Я только что установил подключение к удаленному рабочему столу на сервере Ubuntu LTS, и всякий раз, когда я пытаюсь что-то установить, окно запрашивает пароль. Я пытался ввести пароль, но он не принимаю его. Я не знаю, какой пароль запрашивается, но это не тот, который я установил.

Я попытался поискать в Google и нашел несколько способов решить эту проблему, но как только я слежу за ней в терминале, я получаю еще одну ошибку: Пользователь отсутствует в файле sudoers. Об инциденте будет сообщено . Затем я поискал в Интернете, чтобы решить эту проблему, но потом они говорят, что нужно написать su -s в терминале, но затем я получаю сообщение об ошибке su: Ошибка аутентификации .

0
задан 12 August 2020 в 12:34

1 ответ

The reason for this is the user through which you enter commands is not the part of "super user" group. All the users in "super user" group can execute command as a root user. Therefore, even if you specify the correct password for that specific user unless it is part of "super user" group" it cannot execute sudo.

To solve the issue you need to add this user to the sudoers file.
To do this you can follow these commands :

sudo usermod -aG sudo user

Replace the user with the username you want to add to the sudoers. The -aG option tells the system to append the user to the specified group. (The -a option is only used with G.).

As you can see to add someone to the sudoers you first need a user who can exercise the "super user" rights. So either add this user to sudoers or you can use the user which is already added in "super user" group.

You can also read this

P.S.

On some Linux distributions like Ubuntu, the root user account is disabled by default for security reasons. This means that no password is set for root and you cannot use su to switch to root. This explains the reason for su:Authentication failure

One option to change to root would be to prepend the su command with sudo and enter the currently logged in user password:

sudo su -

However it is not recommend to switch to root user to perform actions as it will have permission issues when you try to access or make changes later.

0
ответ дан 21 August 2020 в 08:03

Другие вопросы по тегам:

Похожие вопросы: