How to Ban Players on Your Counter-Strike 2 Server

Ban players by SteamID or IP on your CS2 dedicated server using banid, banip, banned_user.cfg, and banned_ip.cfg.

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

Find the player's user ID with the status command (RCON or console).

Run:

banid <minutes> <userid>

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

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

writeid

Ban a Player by IP

Find the user ID with status.

Run:

banip <minutes> <userid>

Save:

writeip

Auto-Load Bans on Startup

Make sure your server.cfg ends with:

exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip

This loads the lists every time the server starts.

Unban a Player

removeid <steamid>
writeid
removeip <ip>
writeip

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.

How is this guide?

40% Off — Limited TimeGet your Counter Strike 2 server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page