Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

On a Team Fortress 2 community server running SourceMod, ban a connected player with sm_ban <#userid|name> <minutes|0> [reason]. Use a positive number for the ban length in minutes, or 0 for a permanent ban. For someone who is offline, use sm_addban <minutes|0> <steamid> [reason]. Remove a Steam ID or IP ban with sm_unban <steamid|ip>.

The reliable workflow is to identify the player from the server’s status output, prefer a Steam-authenticated identity over an IP address, and make sure your SourceMod account has the correct administrative capability. Ban, unban and arbitrary-IP operations are separate permissions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before issuing a ban

These commands are provided by SourceMod’s basebans plugin. Your TF2 server must have SourceMod installed, the basebans layer enabled, and your account configured with the required administrative flag.

  • Ban permission: required for sm_ban and sm_banip when targeting a connected player.
  • Unban permission: required for sm_unban.
  • RCON access: required by sm_addban, and by an arbitrary IP ban issued through sm_banip.

Having one capability does not automatically grant the others. If a command is recognized but rejected for permission reasons, have the server owner assign the appropriate SourceMod flag rather than sharing the RCON password.

#1 Best Overall
Team Fortress 2 - PC (Collector's)
  • Nine unique character classes, each providing a completely unique play experience for players of varying skills
  • Advanced graphics that offers a unique game environment while providing game information within the visuals
  • Support for up to 24 players
  • Introduces new multiplayer game modes and support for voice chat
  • Automatic updates – Stop wasting time looking for patches or new content

Identify the correct player

Before banning, run the server’s status command and inspect the connected-player list. It gives you the identifiers needed when a name is ambiguous or changes frequently.

SourceMod targeting accepts an exact or unique player name, a #userid, or a #steamid. A userid is tied to the current connection, so it is usually safer than typing a long or duplicated display name. A Steam ID is the durable identity to retain for future action. When a Steam ID contains colons, quote the value so the command parser receives it as one argument.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
The Orange Box - PC
  • Characters - Advanced facial animation system delivers the most sophisticated in-game characters ever seen. With 40 distinct facial muscles, human characters convey the full array of human emotion, and respond to the player with fluidity and intelligence
  • Physics - From pebbles to water to 2-ton trucks respond as expected, as they obey the laws of mass, friction, gravity, and buoyancy
  • Graphics - Source's shader-based renderer, like the one used at Pixar to create movies such as Toy Story and Monster's, Inc., creates the most beautiful and realistic environments ever seen in a video game.
  • AI - Neither friends nor enemies charge blindly into the fray. They can assess threats, navigate tricky terrain, and fashion weapons from whatever is at hand

Target forms

Target When to use it Important detail
#userid The player is connected and you have the value from status. Unambiguous for that current connection.
Exact or unique name You can identify the connected player by name. Names can collide or change; use a userid when possible.
#steamid The player is connected and you want to target by Steam-authenticated identity. Quote a Steam ID containing colons.
Steam ID without a connected target The player has left the server. Use sm_addban, not sm_ban.
IP address You specifically need an address-based restriction. IP addresses can be shared or change; treat this as a targeted tool.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Ban a connected player with sm_ban

sm_ban is the shortest workflow when the player is currently online.

sm_ban <#userid|name> <minutes|0> [reason]
  1. Run status and confirm the player’s current userid, name, or Steam-authenticated target.
  2. Choose the duration. Enter a positive number for that many minutes. Enter 0 for a permanent ban.
  3. Add a concise reason after the duration. The reason is optional, but including one makes later administration easier.
  4. Submit the command through your SourceMod admin console or the server console, using the account with ban permission.

Temporary example

sm_ban #42 30 repeated mic spam

This targets userid 42 for 30 minutes and supplies “repeated mic spam” as the reason.

Permanent example

sm_ban #42 0 repeated cheating

In SourceMod’s ban syntax, 0 means permanent; it is not a zero-minute or immediately expiring ban.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
Team Fortress 2 - PC (Collector's)
Team Fortress 2 - PC (Collector's)
Support for up to 24 players; Introduces new multiplayer game modes and support for voice chat
$24.95
Bestseller No. 2
Bestseller No. 3
Bestseller No. 4
Island Fortress by Game Salute
Island Fortress by Game Salute
For 2-4 players; Ages 13 and up; 90 minute playing time
$34.00
SaleBestseller No. 5
Team Fortress 2 - Cartoonified Design Decal Sticker - Graphic for Auto, Wall, Laptop, Cell, Truck Windows, Cars
Team Fortress 2 - Cartoonified Design Decal Sticker - Graphic for Auto, Wall, Laptop, Cell, Truck Windows, Cars
Brand: decals; Material: Vinyl; Surface recommendation: Metal,Plastic; Item shape: Rectangular
$1.99
Best Value
Sale
Team Fortress 2 - Cartoonified Design Decal Sticker - Graphic for Auto, Wall, Laptop, Cell, Truck Windows, Cars
  • Brand: decals
  • Material: Vinyl
  • Surface recommendation: Metal,Plastic
  • Item shape: Rectangular
  • Installation type: Stick
Rank #4
Island Fortress by Game Salute
  • For 2-4 players
  • Ages 13 and up
  • 90 minute playing time

Using a name instead of a userid

sm_ban 

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.