Linux – How to fix [user] is not in the sudoers file

Linux

The sudoers file is a file Linux and Unix administrators use to allocate system rights to system users.

How to reproduce it

sudo whoami
# output
<user> is not in the sudoers file.  This incident will be reported

Solution

Switch to root

su root
sudo whoami
# output
root

Update the sudoers file – add the user

nano /etc/sudoers

Add user

<user> ALL=(ALL:ALL) ALL

Save changes and exit

su <user>
sudo whoami
# output
root
https://www.mldgroup.com

Vyštudovaný top manažér pôsobiaci najmä ako manažér, marketér, softvérový inžinier, konzultant, bloger, YouTuber a zatiaľ neúspešný hudobník a producent. V rámci praxe pôsobil v rôznych odvetviach na rôznych pozíciách v malých aj veľkých firmách, vrátane spoluprác a partnerstiev s významnými firmami či poradenskými spoločnosťami.

Comments are closed.