How to set a password on a CS2 server
Type sv_password "scrim2024" in the server console so players need that password to join; sv_password "" makes it public again.
sv_password
Sets a password players must enter to join the server.
sv_password <password> Examples
sv_password "scrim2024" Lock the server with a password.
sv_password "" Remove the password.
Arguments
passwordRequired- Join password. Empty quotes remove it.
On SLASHPLAY
SLASHPLAY manages this one: set the join password with Join password on the server's General tab. A value set in the console or a cfg overrides the dashboard and the copied connect line stops working.
What it does
Players type password yourpassword in their console before connect, or enter it when the game asks. Set it to an empty string to make the server public again.
The game's own description: Server password for entry into multiplayer games
Run it on your server
On a SLASHPLAY server, type it in the Console tab of the server page; the reply shows right under it. A value set there lasts until the server restarts. To keep it, add the line to game/csgo/cfg/server.cfg. New to this? Start a CS2 server first.
Your own
CS2 server.
From $0.03 an hour, only while it runs. New accounts get 6 free tokens.