Left 4 Dead 2 administration uses the Source engine’s server console. Enter native commands in the dedicated-server console, or send the same commands remotely through authenticated RCON. For moderation, identify a player with users or status, then use kick, dropclient, banid or addip. Use maps to find a map name and changelevel to load it.
The in-game developer console is only an entry point: it can send RCON commands, but it does not automatically grant control over a dedicated server. SourceMod is an optional plugin layer that adds an admin menu and permission-controlled commands such as sm_kick and sm_ban. Permanent bans also need to be written to the server’s ban files, and Valve changed one important matchmaking cvar in March 2024.
Where can I run Left 4 Dead 2 server commands?
There are three execution paths, and choosing the right one prevents many “command does nothing” problems. The command syntax may look similar in each path, but the authority behind it is different.
Dedicated-server console
Run native Source commands directly in the console exposed by your host panel or by the dedicated-server process. This is the authoritative path for commands such as users, banid, changelevel and exec. A command entered here affects the server on which the console is running, whether players are currently connected or not.
If a managed host provides a browser console, treat it as the same server-side interface. The panel may add buttons or a command history, but the underlying commands are still executed by the dedicated server. Keep track of which server instance you selected before running a map change or ban command.
RCON from the game console
RCON lets an authorized operator send server-console commands from the game. In your client console, set the server password with rcon_password <your_password>, then prefix a server command with rcon, for example rcon changelevel c2m1_highway. You can use the same pattern for inspection, such as rcon users or rcon status.
RCON is remote console access, not a chat command. Keep the password private; anyone who obtains it can issue administrative commands, including kicks, bans and map changes. Do not paste it into screenshots, public configuration examples, chat, or shared troubleshooting logs.
SourceMod
SourceMod is an optional plugin and permission system. After it is installed and your account is granted admin access, you can open its menu with sm_admin or use sm_* commands. SourceMod commands are not a replacement for configuring the underlying dedicated server; they are an additional control layer that can provide target selectors, reasons and permission checks.
How do I open the L4D2 developer console?
Enable it in the game before attempting RCON or client-side diagnostics.
- Open Options.
- Choose Keyboard/Mouse.
- Set Allow Developer Console to Enabled.
- Press the configured console key, usually
~on an English/US keyboard layout.
The console is a text-based input/output interface for commands and global settings. Opening it does not by itself make you a server administrator. You still need to be the host, have a valid RCON password, or possess SourceMod permissions.
If you only want to inspect your local client, the console is still useful, but a local client console is not the dedicated-server console. A native moderation command entered without server authority may appear to do nothing. In that case, connect to the intended server, authenticate RCON, or use the host’s server-console window.
Which native commands identify players and server state?
Run an identification command before moderation. UserIDs are useful for an immediate connection, while SteamIDs are the durable identifier needed for a persistent ban.
| Command | Purpose | Example or result |
|---|---|---|
users |
Lists connected users and their UserIDs and SteamIDs. | users |
status |
Shows connected players plus fuller server status information. | status |
info <SteamID> |
Displays information for a client identified by SteamID. | info STEAM_1:0:123456 |
maps <partial_name> |
Lists map names containing the supplied text. | maps c2m1 |
When two players have similar names, do not rely on the display name. Copy the UserID or SteamID from users or status and target that identifier instead. A UserID belongs to the current connection; after a reconnect, the same person can receive a different UserID. A SteamID identifies the account and is therefore the appropriate value for banid.
Use status when you need the broader server picture, not only a target’s identifier. It is a useful first diagnostic when players report that the wrong server or map is active. Keep the output private if it contains information you do not want to publish.
How do I kick a player from an L4D2 server?
Use kick for a normal removal or dropclient when you specifically want to drop a connection by UserID.
| Command | What it does |
|---|---|
kick <player_name> |
Removes a player by name. |
kick <UserID> |
Removes the connection associated with that UserID. |
dropclient <UserID> |
Drops a client by UserID. |
Names containing spaces may require the quoting convention supported by your host console. A UserID avoids ambiguity and is generally safer. A kick is not a ban: the player can reconnect unless another control, such as a ban or a matchmaking restriction, prevents it.
Before acting, run users or status, note the target’s current UserID, and then issue the kick promptly. If several players join or leave between the two commands, recheck the list rather than assuming the old UserID still refers to the same person. For a one-time removal, do not create a permanent ban simply because a kick is available.
How do I ban someone with native server commands?
Use the SteamID for a player-specific ban, and use an IP ban only when an address-based rule is appropriate. Add kick to a SteamID ban when the player must be removed immediately.
SteamID bans
| Command | Effect |
|---|---|
banid <minutes> <SteamID> |
Bans the SteamID for the specified number of minutes. |
banid <minutes> <SteamID> kick |
Bans the SteamID and kicks the player immediately. |
banid 0 <SteamID> kick |
Creates a permanent native ban and removes the current connection. |
Valve documents 0 minutes as permanent for banid. Always verify that you copied the intended SteamID; banning a display name instead of the identifier can affect the wrong person. For a temporary policy, enter the duration in minutes and leave out the permanent value. For an immediate removal plus a temporary or permanent restriction, include the final kick argument.
IP bans
| Command | Effect |
|---|---|
addip <minutes> <IP> |
Adds an IP ban for the specified duration. |
addip 0 <IP> |
Adds a permanent IP ban. |
IP bans can affect other players who share an address and may be less reliable when a user’s address changes. Prefer a SteamID ban when your policy is intended to follow one account. Use an IP ban only when you deliberately want the address-based effect and have checked the address carefully.
Inspecting and changing ban lists
listidlists SteamIDs on the server ban list.listiplists IP addresses on the server ban list.filterban 0toggles IP filtering off according to the ban-management reference. Check the current and intended value before changing this on a live server.
Listing a ban confirms what the server currently knows; it does not by itself prove that the entry will survive a restart. Persistence requires the write and startup steps described below.
How do I change the L4D2 map from the console?
First discover the exact internal map name, then load it with changelevel.
- Run
maps <partial_name>, such asmaps c2m1, to narrow the list. - Copy the complete map identifier returned by the server.
- Run
changelevel <map>, for examplechangelevel c2m1_highway.
Searching by a partial name is safer than guessing a campaign identifier. If maps c2m1 returns several entries, choose the exact one shown by the server. A spelling error or an incomplete identifier can make the command fail.
changelevel changes the current level for everyone connected and can interrupt an active round. Warn players before using it on a live session. If you need to reload a deliberate configuration instead of changing maps, use exec <config_file>.
What other server-control commands are useful?
| Command | Use |
|---|---|
heartbeat |
Manually sends a heartbeat to the master server. |
exec <config_file> |
Loads a configuration file. The L4D2 server workflow uses this for banned-user and banned-IP files. |
writeid |
Writes the permanent SteamID ban list to the server’s ban file in the documented workflow. |
writeip |
Writes the permanent IP ban list to the server’s ban file. |
Use exec intentionally: loading an unrelated configuration can change multiple settings at once. Keep a record of the file you loaded so another administrator can reproduce the server state. The heartbeat command is a server-control action, not a substitute for a map change or a player-management command.
How do I use RCON safely?
RCON is convenient when the server is hosted elsewhere, but it is effectively remote console access.
- Set a strong, unique RCON password in the server configuration or host panel.
- Connect to the server and open the client developer console.
- Enter
rcon_password <your_password>. - Test with a low-risk command such as
rcon status. - Send the required native command, for example
rcon usersorrcon changelevel c2m1_highway. - Remove the password from shared screenshots, scripts and chat logs.
If the server returns no useful response, check that you are connected to the intended server, that the password matches its current setting, and that the host permits RCON. A client console opened without a valid RCON credential cannot administer a remote dedicated server.
Use RCON for the same deliberate sequence you would use locally: inspect first, target by identifier, execute one action, and verify the result. For example, run rcon users, record the SteamID, issue rcon banid 30 <SteamID> kick, and then check the appropriate ban list. This reduces the chance of acting on a stale player list or the wrong server instance.
What does SourceMod add?
SourceMod adds a permission-aware command layer and an in-game menu. An operator must be granted admin access before these commands work.
| Command | Syntax | Purpose |
|---|---|---|
sm_admin |
sm_admin |
Opens the SourceMod admin menu in game. |
sm_kick |
sm_kick <target> [reason] |
Kicks a target, with an optional reason. |
sm_ban |
sm_ban <target> <minutes> [reason] |
Applies a SourceMod ban for the selected duration and optional reason. |
sm_unban |
sm_unban <SteamID/IP> |
Removes a SourceMod ban. |
sm_cvar |
sm_cvar <cvar> <value> |
Reads or sets a protected cvar when the administrator has the required permission. |
The target syntax and menu behavior come from SourceMod’s administration layer, so use the plugin’s documented target notation when selecting a player. If a command is unknown, first confirm that SourceMod is installed and running; if the command is recognized but denied, check the account’s flags.
Which SourceMod flags should an administrator receive?
SourceMod access flags are cumulative. One documented permissions mapping assigns:
c: kick accessd: ban accessg: map-change accessh: cvar administrationm: RCON accessz: root access
Give each moderator the narrowest combination that meets the job. A person who only needs to remove disruptive players may need c; someone who also handles bans may need c and d. Add g, h or m only when those duties are intentional. Root access is broader than ordinary kick or ban duties and should not be used as a shortcut for every administrator.
How do I make a permanent ban survive a restart?
A command that works during the current session is not necessarily a persistent policy. Use this sequence for a native permanent ban:
- Run
usersorstatusand record the target’s SteamID. - Run
banid 0 <SteamID> kickif the current connection must end immediately. - Use the server’s documented
writeidworkflow to write the SteamID ban list. For IP bans, usewriteip. - Confirm the entry with
listidorlistip. - Ensure the relevant banned-user and banned-IP files are executed when the server starts, using the appropriate
exec <config_file>configuration.
The order matters. If you skip the write step, the server may know about the ban only until the process or map session ends. If you write the list but do not execute the relevant files at startup, a restart may load no entries. Confirm both the in-memory list and the startup configuration.
Host panels and plugins can change file locations and startup behavior. The command forms are consistent, but there is no single panel layout or universal path; verify where your installation writes and loads its ban files. SourceMod-managed bans can have their own storage and removal workflow, so identify which system created an entry before attempting to remove it.
Why might matchmaking ignore my forced-server setting?
Valve’s March 11, 2024 Left 4 Dead 2 update changed the scope of mm_dedicated_force_servers. It now applies only to lobbies using Best Available Dedicated.
For forcing available official servers at requested IP addresses, Valve says to use mm_dedicated_force_official_servers instead. This is a matchmaking-cvar distinction, not a replacement for RCON, SourceMod or the changelevel command. Because matchmaking behavior is version-sensitive, check Valve’s current update notes before deploying a hard-coded lobby recipe.
These cvars affect how a lobby seeks an official dedicated server; they do not grant administrative privileges on that server. Once you are operating your own dedicated instance, use its console, RCON credentials or SourceMod permissions for administration.
What should I check when a command fails?
- “Unknown command”: confirm you are using a native command in a server console, or the correct
sm_command after SourceMod is installed. - RCON has no effect: verify the server address, the current RCON password and whether the host allows remote RCON.
- The wrong player is targeted: rerun
usersorstatusand use the UserID or SteamID rather than a similar display name. - A ban disappears after restart: check
listidorlistip, run the appropriate write command, and verify that the ban file is executed at startup. - A map change fails: run
mapswith a partial name and copy the exact returned map identifier. - SourceMod says permission denied: ask a higher-level administrator to grant the specific flag required for the command instead of assigning root access automatically.
- The command affects a different server: verify the selected host-panel instance or the server address used for RCON before repeating a destructive action.
- A reconnect bypasses a kick: remember that
kickis temporary; use a correctly targetedbanidoraddiprule when a restriction must continue after reconnecting.
What is the safest administration routine?
For routine moderation, identify first, act second, verify third. Record the UserID and SteamID from users or status; use kick for a one-time removal; use banid with a duration and optional kick for a ban; then confirm persistent entries with listid or listip. Reserve IP bans for cases where an address-based rule is intentional, protect RCON credentials, and grant SourceMod flags narrowly.
For map operations, search with maps, confirm the complete identifier, notify connected players, and then run changelevel. For configuration operations, use exec only with a file you intend to load and document what changed. For persistent moderation, save the list and verify startup execution instead of assuming a successful command is permanent.
Left 4 Dead 2 is Valve’s PC game released on November 16, 2009, with online co-op and Steam Workshop support. Its long-lived dedicated-server tools remain practical, but hosting panels, plugins and matchmaking updates can alter how a command is exposed or persisted.
Frequently Asked Questions
Can I run server commands from the normal pause menu?
No. Native administration commands require the dedicated-server console or authenticated RCON. The developer console can send RCON commands, but simply opening it does not grant server privileges.
What is the difference between a UserID and a SteamID in L4D2?
A UserID identifies a client connection on the current server session and is suitable for commands such as dropclient. A SteamID is the account identifier used by banid and is the better choice when a ban must follow the account after reconnecting.
Can SourceMod remove a native ban?
sm_unban removes a ban managed by SourceMod. A native ban created with banid or addip must be removed through the server’s native ban-management workflow, so check which system created the entry.
Does changing the map restart the campaign?
changelevel loads the selected map for the server and can interrupt the current round. It does not by itself explain how campaign progress is restored, so treat it as an immediate level transition rather than a harmless preview command.
Which command should I use for a temporary removal?
Use kick <UserID> or dropclient <UserID> after confirming the current UserID. A kick removes the connection but does not prevent a later reconnect.
How do I ban and remove a player in one step?
Run banid <minutes> <SteamID> kick. Use 0 for a permanent native ban, then follow the writeid and startup-file steps if the entry must survive a restart.
Should I use an IP ban or a SteamID ban?
Use a SteamID ban when the restriction should follow one account. Use addip only when an address-based rule is intentional, because shared or changing IP addresses can affect innocent players or fail to identify the same person later.
Why does SourceMod show an access error?
The account has not been granted the required cumulative flag. The documented mapping uses c for kick, d for ban, g for map changes, h for cvar administration, m for RCON and z for root. Grant only the flags needed for the role.
What should I do if a permanent ban vanishes after a restart?
Check listid or listip, run writeid or writeip as appropriate, and verify that the relevant banned-user or banned-IP file is loaded with an intentional exec <config_file> startup workflow. Host panels and plugins may use different paths.
What changed about forced dedicated servers in 2024?
Valve’s March 11, 2024 update says mm_dedicated_force_servers applies only to lobbies using Best Available Dedicated. For available official servers at requested IP addresses, Valve directs operators to mm_dedicated_force_official_servers.
The Bottom Line
Use the dedicated-server console or authenticated RCON for native L4D2 commands. Identify players with users or status, target UserIDs for immediate actions and SteamIDs for bans, discover maps with maps, and load them with changelevel. Save permanent bans with writeid/writeip and verify startup execution. SourceMod adds convenient commands and menus, but its permissions and ban storage are separate from native administration.