# user is not in the sudoers file. This incident will be reported.

**Code:** `sudoers` · **Category:** Linux · **Seen on:** Linux

Your account isn’t allowed to use sudo.

## Meaning

sudo access comes from `/etc/sudoers` or group membership (`sudo` on Debian/Ubuntu, `wheel` on RHEL/Fedora). New users on servers and some fresh desktop installs don’t have it.

## Common causes

- User not in the sudo/wheel group
- Group added but session not refreshed (log out/in)
- Broken sudoers file after manual editing

## Quick fix

1. As root: `usermod -aG sudo username` (Ubuntu) or `usermod -aG wheel username` (RHEL)
2. Log out and back in
3. Always edit sudoers with `visudo`

## Detailed fix by platform

### Linux

1. Grant sudo (run as root, e.g. `su -`):

```bash
usermod -aG sudo deploy       # Debian/Ubuntu
usermod -aG wheel deploy      # RHEL/CentOS/Fedora
groups deploy
```


## How to diagnose

1. **Groups** — `groups` — sudo or wheel present?
2. **Session** — Logged in again since?
3. **Config** — `visudo -c` passes?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/user-is-not-in-the-sudoers-file)
