# How to Set a Password on Your Killing Floor 2 Server (/docs/killing-floor-2/set-a-password)



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

Setting a server password restricts access to only players who know the password. This is useful for private sessions with friends, community events, or any situation where you want to control exactly who can join your Killing Floor 2 server.

Setting Your Server Password [#setting-your-server-password]

<div className="fd-steps">
  <div className="fd-step">
    Open the XGamingServer panel [#1-open-the-xgamingserver-panel]

    Log in to the [XGamingServer panel](https://panel.xgamingserver.com) and stop your Killing Floor 2 server.
  </div>

  <div className="fd-step">
    Navigate to the config file [#2-navigate-to-the-config-file]

    In the sidebar, go to `Files` and navigate to `KFGame` > `Config`. Open `PCServer-KFGame.ini`.
  </div>

  <div className="fd-step">
    Set the game password [#3-set-the-game-password]

    Find the `[Engine.AccessControl]` section and set the `GamePassword` value:

    ```ini
    [Engine.AccessControl]
    GamePassword=YourServerPassword
    ```
  </div>

  <div className="fd-step">
    Save and restart [#4-save-and-restart]

    Click **Save** and start your server.

    Players will now be prompted to enter the password when they try to join from the server browser or via [direct connect](/docs/killing-floor-2/connect-to-your-server).
  </div>
</div>

How Password Protection Works [#how-password-protection-works]

* **Server browser** — Your server still appears in the server browser, but with a **lock icon** indicating it requires a password. Players can see your server name, player count, and map, but can't join without the password.
* **Direct connect** — Players connecting via the console command can include the password: `open 198.137.23.46:7777?password=YourServerPassword`
* **Sharing the password** — Share your server password with your group through Discord, your community website, or private messages. Avoid putting the password in your [server name](/docs/killing-floor-2/change-server-name).

Removing the Password [#removing-the-password]

<div className="fd-steps">
  <div className="fd-step">
    Stop your server [#1-stop-your-server]

    Stop your server from the XGamingServer panel.
  </div>

  <div className="fd-step">
    Clear the password [#2-clear-the-password]

    Open `PCServer-KFGame.ini`, find the `[Engine.AccessControl]` section, and clear the `GamePassword` field:

    ```ini
    GamePassword=
    ```
  </div>

  <div className="fd-step">
    Save and restart [#3-save-and-restart]

    Click **Save** and start your server.

    Your server will now be open to anyone without requiring a password.
  </div>
</div>

Setting a Password via Admin Command [#setting-a-password-via-admin-command]

If you have [admin access](/docs/killing-floor-2/adding-admins), you can set or remove the password while the server is running:

```
Admin SetGamePassword NewPassword
```

To remove the password:

```
Admin ClearGamePassword
```

> 📝 **Note:** Passwords set via admin commands are temporary — they'll revert to whatever is in `PCServer-KFGame.ini` when the server restarts. For permanent changes, update the config file.

Server Password vs. Admin Password [#server-password-vs-admin-password]

Killing Floor 2 has two separate passwords that control different things:

| Password                                                  | Purpose                                                      | Config Setting                              |
| --------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------- |
| **Game Password**                                         | Controls who can **join** the server                         | `GamePassword` in `[Engine.AccessControl]`  |
| **[Admin Password](/docs/killing-floor-2/adding-admins)** | Controls who can **manage** the server (kick, ban, WebAdmin) | `AdminPassword` in `[Engine.AccessControl]` |

These are completely independent — you can have one, both, or neither. Setting a game password doesn't affect admin access, and vice versa.

> 💡 **Tip:** For organized events, set the server password before the event starts and share it with participants. Change it afterward to prevent uninvited players from joining during your next session.

If you get stuck at any time, you can join our [Discord](https://discord.xgamingserver.com/).
