How to Ban Players on Your CS 1.6 Server
Ban by Steam ID or IP, persist bans through restarts, manage ban files directly, and avoid the one config mistake that gets every player kicked on join.
Two Types of Bans
CS 1.6 bans work two ways: by Steam ID and by IP address. Steam ID bans are better — they follow the player even if they change IPs. IP bans catch players who don't own the game (who have no Steam ID on your server).
Steam ID Bans
banid 0 STEAM_0:0:12345678 kick // permanent ban, kick immediately
banid 60 STEAM_0:0:12345678 kick // 60-minute ban, kick immediately
banid 1440 STEAM_0:0:12345678 kick // 24-hour ban
writeid // IMPORTANT: save to disk
The number after banid is the ban duration in minutes. 0 means permanent.
Always run writeid after banning. Without it, the ban lives only in memory and disappears when the server restarts.
IP Bans
addip 0 192.168.1.100 // permanent IP ban
addip 60 192.168.1.100 // 60-minute IP ban
writeip // IMPORTANT: save to disk
Same pattern — duration in minutes, 0 for permanent, always save with writeip.
Unbanning
removeid STEAM_0:0:12345678 // remove Steam ID ban
removeip 192.168.1.100 // remove IP ban
writeid // save the change
writeip
AMX Mod X Ban Commands
AMX wraps these commands and adds logging. For most admin actions, use AMX instead of raw console commands:
amx_ban "PlayerName" 60 "Griefing" // ban for 60 minutes with reason
amx_ban "PlayerName" 0 "Cheating" // permanent ban
amx_unban STEAM_0:0:12345678 // unban by Steam ID
AMX ban commands also write to the server log with the admin's Steam ID attached, so you have an audit trail.
Ban Files on Disk
Both ban types are stored as plain config files that the server executes on startup:
cstrike/banned.cfg— Steam ID bans (containsbanidcommands)cstrike/listip.cfg— IP bans (containsaddipcommands)
You can edit these files directly with a text editor. This is useful for bulk operations — for example, merging a community ban list or removing all bans at once.
The Dangerous Mistake: banid 0 0:0:0
This is the most common ban-related disaster. If your banned.cfg contains the line:
banid 0 0:0:0
It bans every player who connects, including all admins. The server appears to be running but nobody can join — everyone gets a "You have been banned from this server" message instantly.
Check your banned.cfg if this happens. Find and delete that line, then run exec banned.cfg or restart the server.
This entry can get into banned.cfg by accident if someone runs banid 0 0:0:0 in the console (which targets "all players") and then runs writeid. Check the file after any mass ban operation.
Getting Steam IDs Before Banning
If a player is causing trouble, get their Steam ID before they disconnect:
In the server console:
status
The output lists every player with their Steam ID in STEAM_0:X:XXXXXXXX format. Copy it before they leave.
AMX also captures Steam IDs in the server log for every connection, so you can always look up a past player's Steam ID in cstrike/logs/.