techjunctionuser@linuxserver:~> sudo su - [sudo] password for techjunctionuser: techjunctionuser is not in the sudoers file. This incident will be reported.
Tech Junction Changed status to publish March 7, 2025
It looks like your user techjunctionuser
is not in the sudoers file, which is why you’re seeing that error. To fix this, you need to add the user to the sudoers file. Here’s how you can do it:
- Switch to the root user (or login as root): If you have access to the root account, you can switch to it using:
# su -
- Edit the sudoers file: Use the
visudo
command to safely edit the sudoers file:
# visudo
This command opens the /etc/sudoers
file in a text editor.
- Add the user to the sudoers file: Add the following line to the file, replacing
techjunctionuser
with your username:
techjunctionuser ALL=(ALL) ALL
This grants the user techjunctionuser
permission to run any command as any user.
- Save and exit: Save the changes and exit the editor. If you’re using
nano
, you can do this by pressingCtrl+X
, thenY
, andEnter
.
Alternatively, you can add the user to the sudo
group, which is often pre-configured to grant sudo privileges:
- Add the user to the sudo group:
# usermod -aG sudo techjunctionuser
- Log out and log back in: The changes will take effect the next time the user logs in.
This should resolve the issue and allow techjunctionuser
to use sudo
commands. If you have any other questions or run into issues, feel free to ask!
Tech Junction Edited answer March 7, 2025