# How to Set a Password on Your CS2 Server (/docs/counter-strike-2/server-password)



import { Step, Steps } from 'fumadocs-ui/components/steps';

In `server.cfg`:

```
sv_password "YourPassword"
```

Leave empty for a public server: `sv_password ""`

Players connect with: `connect IP:PORT; password YourPassword`

Related Guides [#related-guides]

* [Server Configuration](/docs/counter-strike-2/server-config)
