# How to Ban Players on Your Counter-Strike 2 Server (/docs/counter-strike-2/ban-players)



import { Step, Steps } from 'fumadocs-ui/components/steps';

CS2 inherits the Source ban system. Bans are applied with console/RCON commands and persisted to two files in `game/csgo/cfg/`:

* `banned_user.cfg` — SteamID bans
* `banned_ip.cfg` — IP bans

Ban a Player by SteamID [#ban-a-player-by-steamid]

<Steps>
  <Step>
    Find the player's user ID with the `status` command (RCON or console).
  </Step>

  <Step>
    Run:

    ```
    banid <minutes> <userid>
    ```

    `<minutes>` of `0` = permanent. Example: `banid 0 12` permabans user ID 12.
  </Step>

  <Step>
    Save the ban list to disk so it persists across restarts:

    ```
    writeid
    ```
  </Step>
</Steps>

Ban a Player by IP [#ban-a-player-by-ip]

<Steps>
  <Step>
    Find the user ID with `status`.
  </Step>

  <Step>
    Run:

    ```
    banip <minutes> <userid>
    ```
  </Step>

  <Step>
    Save:

    ```
    writeip
    ```
  </Step>
</Steps>

Auto-Load Bans on Startup [#auto-load-bans-on-startup]

Make sure your `server.cfg` ends with:

```ini
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip
```

This loads the lists every time the server starts.

Unban a Player [#unban-a-player]

```
removeid <steamid>
writeid
```

```
removeip <ip>
writeip
```

Edit Ban Files Directly [#edit-ban-files-directly]

You can also edit `banned_user.cfg` / `banned_ip.cfg` in the **Files** manager. Each line follows this format:

```
banid 0 STEAM_1:0:12345678
```

Stop the server before editing to avoid being overwritten by `writeid`/`writeip`.

Related Guides [#related-guides]

* [RCON Setup](/docs/counter-strike-2/rcon-setup)
* [Server Configuration](/docs/counter-strike-2/server-config)
