Griefers, prop-spammers, and rule-breakers are a fact of life when you run a public Garry’s Mod server. Knowing exactly how to remove them — temporarily or permanently, by player slot, SteamID, or IP — is one of the most important skills a GMod admin can have. This guide covers everything: the vanilla Source-engine console commands that ship with every dedicated server, how to find the right ID for the right person, how to make your bans survive a server restart, and how the admin mods most communities actually run (ULX and SAM) turn all of this into a single chat command.
Everything here runs from your server console or through RCON, and all of the persistent settings live in garrysmod/cfg/server.cfg — the config file Garry’s Mod auto-executes every time the server starts. If you’re standing up a fresh box, our managed Garry’s Mod hosting plans give you that console and config access out of the box, and the Garry’s Mod documentation walks through the full setup.
Step 1: Find the player’s userid or SteamID with status
Before you can ban anyone, you need to identify them. Run the status command from the server console (or via RCON) to print a list of every connected player. The output gives you two things that matter for banning: the userid — the small leading # assigned for the current session — and the SteamID, the permanent identity in the form STEAM_1:1:13967715.
status
# userid name uniqueid connected ping ...
# 2 "Griefer McProps" STEAM_1:1:13967715 04:12 45
# 3 "RegularPlayer" STEAM_1:0:55512345 17:48 32
Use the userid (here, 2) for quick in-session actions like kicking or temp-banning. Use the SteamID (STEAM_1:1:13967715) when you want a permanent ban that survives reconnects — the userid changes every time a player rejoins, but the SteamID never does.
Step 2: Ban with the vanilla console commands
Garry’s Mod is built on the Source engine, so it inherits the standard Source ban command set. These work on a stock dedicated server with no addons installed. The core command is banid:
# banid
# 0 minutes = PERMANENT ban
banid 30 2 # ban userid 2 for 30 minutes
banid 0 2 # ban userid 2 permanently
banid 0 STEAM_1:1:13967715 # ban by SteamID, permanent
The argument is the ban length, and 0 means permanent. You can pass either the in-session userid or the player’s SteamID — the SteamID is the safer choice for permanent bans because it identifies the actual account rather than a temporary slot number.
Banning by IP address
If a troublemaker keeps making new Steam accounts, an IP ban can be more effective. Two commands handle IP banning:
# banip — 0 = permanent
banip 0 2 # ban the IP of userid 2, permanently
banip 60 203.0.113.45 # ban a raw IP for 60 minutes
# addip — add an IP straight to the ban list
addip 0 203.0.113.45
Note that IP bans are blunt instruments — players behind shared or dynamic IPs (mobile networks, university campuses, CGNAT) can be caught up or escape over time. SteamID bans are usually the better default; reserve IP bans for persistent ban-evaders.
Kicking instead of banning
Sometimes you just want someone gone now, not gone forever. kickid and kick remove a player without adding them to the ban list:
kickid 2 "Stop prop-spamming" # kick by userid (or SteamID) with a reason
kickid STEAM_1:1:13967715 "Final warning"
kick "RegularPlayer" # kick by name
Lifting a ban
Made a mistake, or ready to give someone a second chance? Remove the ban with removeid (for a SteamID) or removeip (for an IP):
removeid STEAM_1:1:13967715 # un-ban a SteamID
removeip 203.0.113.45 # un-ban an IP
Step 3: Make bans permanent across restarts with writeid and writeip
Here’s the gotcha that catches almost every new admin: by default, the ban list lives only in memory. A “permanent” banid 0 ... ban will vanish the next time you restart the server unless you explicitly write it to disk. The two commands that save your ban lists are:
writeid— writes the SteamID ban list tobanned_user.cfgwriteip— writes the IP ban list tobanned_ip.cfg
So a complete permanent SteamID ban is actually a two-step process:
banid 0 STEAM_1:1:13967715 # add the permanent ban (in memory)
writeid # save the SteamID list to banned_user.cfg
And for IPs:
banip 0 203.0.113.45
writeip # save the IP list to banned_ip.cfg
To make those lists load automatically on startup, your server.cfg can execute them — but in practice most admins simply run writeid/writeip after issuing a ban, and Source loads the .cfg files when the server boots. The spelling matters: it’s writeid and writeip (no underscore), not write_id.
Vanilla ban command cheat-sheet
| Command | What it does |
|---|---|
banid | Ban by userid or SteamID. 0 = permanent. |
banip | Ban by IP. 0 = permanent. |
addip | Add an IP directly to the IP ban list. |
removeid | Remove a SteamID ban. |
removeip | Remove an IP ban. |
kickid | Kick a player (no ban). |
kick | Kick a player by name. |
writeid | Save SteamID bans → banned_user.cfg |
writeip | Save IP bans → banned_ip.cfg |
status | List connected players with userid + SteamID. |
Step 4: The easier way — admin mods (ULX and SAM)
The vanilla commands work, but they’re clunky: you have to be at the server console, look up userids by hand, and remember to run writeid every time. That’s why nearly every real GMod community runs an admin addon. These let trusted staff ban people from in-game chat, with a friendly menu and automatic persistence. The two most common are ULX and SAM.
ULX + ULib
ULX is the long-standing standard admin suite. It requires ULib as a dependency — install both addons or ULX won’t load. Once it’s running, your admins ban people with chat commands typed right into the in-game say box:
!ban # 0 minutes = permanent
!banid # ban an offline SteamID
!kick
# Console equivalents (server console / RCON):
ulx ban
ulx banid
ulx kick
As with vanilla, 0 minutes means a permanent ban. ULX also handles persistence for you — you don’t need to run writeid manually. A big advantage of !banid is that you can ban a player who has already disconnected, just from their SteamID.
SAM (Simple Admin Mod)
SAM is a popular, more modern alternative with a polished menu UI. It provides the same chat-command experience — !ban and !kick — and pops open a menu where you can pick the player, set the duration, and type a reason without memorizing any syntax. If you’re starting fresh and want a clean admin panel, SAM is a strong choice; if you want the largest ecosystem of compatible addons, ULX is the safe bet.
Either way, the principle is the same: define who your admins are, give them ban permission, and they handle moderation from inside the game without ever touching the console.
Where bans and config live
Knowing the file layout helps when you want to edit bans by hand or audit who’s banned:
| File | Purpose |
|---|---|
garrysmod/cfg/server.cfg | Auto-executed on every server start; holds your persistent convars. |
garrysmod/cfg/banned_user.cfg | SteamID ban list (written by writeid). |
garrysmod/cfg/banned_ip.cfg | IP ban list (written by writeip). |
You can open banned_user.cfg in any text editor to see the full ban list — each entry is a banid line. Be careful editing it directly while the server is running, though, since writeid will overwrite the file with the in-memory list.
Banning over RCON (remote administration)
If you don’t have direct console access, you can issue every command above remotely over RCON. Set an rcon_password in server.cfg, then from a connected client’s console authenticate and run commands prefixed with rcon:
rcon_password yourpassword # authenticate
rcon status # list players remotely
rcon banid 0 2 # ban userid 2 permanently
rcon writeid # persist the ban list
RCON sends commands in plaintext, so use a long, random password and lock the port down where you can. For the full setup and security hardening, see our walkthrough on how to modify RCON on your Garry’s Mod server.
Related admin tasks
Banning is one piece of running a clean server. A few neighbouring tasks worth setting up at the same time:
- Stop griefers flying through walls — learn how to disable noclip on your GMod server by setting
sbox_noclip 0. - Most ban issues are debugged from the console — here’s how to enable the in-game developer console so you can type
statusandrconcommands. - If your admin mod or DarkRP stores bans in a database, you’ll likely need MySQLoo installed for MySQL persistence.
Frequently asked questions
How do I permanently ban a player in Garry’s Mod?
Run banid 0 in the server console — 0 minutes means permanent — then run writeid to save it to banned_user.cfg so it survives a restart. Using the SteamID rather than the userid ensures the ban follows the account, not just the current session slot.
Why does my ban disappear after a server restart?
Because the ban list is held in memory by default. After issuing banid or banip, you must run writeid (for SteamID bans) or writeip (for IP bans) to write the list to disk. If you skip that step, the ban is gone the moment the server reboots. Admin mods like ULX and SAM handle this persistence automatically.
What’s the difference between userid and SteamID?
The userid is a small temporary number (like #2) assigned for the current session and shown by status; it changes every time the player reconnects. The SteamID (like STEAM_1:1:13967715) is the player’s permanent Steam identity. Use userid for quick kicks and temp bans, and SteamID for any permanent ban.
How do I unban a player?
Use removeid to lift a SteamID ban, or removeip to lift an IP ban. Run writeid or writeip afterward to save the updated list. With ULX you can use the in-game unban menu instead.
Should I ban by SteamID or by IP?
SteamID is the better default — it targets a specific account and won’t accidentally catch innocent players. IP bans (banip / addip) are useful against persistent ban-evaders who keep making new accounts, but they can sweep up other people on shared or dynamic IP ranges, so use them sparingly.
Do I need an admin mod to ban players?
No — the vanilla banid, banip, and kickid commands work on any dedicated server. But ULX (with ULib) or SAM make moderation far easier with in-game chat commands like !ban and !kick, automatic persistence, and per-rank permissions, which is why almost every community server runs one.
Ready to play?
Run your own Garry's Mod server with XGamingServer
Spin up an always-on Garry's Mod server your friends can join in minutes — no port-forwarding, no tech headaches.







