Articles on: Garry's Mod

Adding a password to your Garry's Mod Server

How to add a password to your Garry's Mod Server


Sometimes you want privacy, and that's understandable whether it's a private server or a development server! Adding a password is the best way to ensure no one can join you uninvited!

Setting a password is very quick and painless and we'll quickly go over how to do it!

Permanent password


Permanent does not mean it can't be removed, it simply means the password will stay on the server as long as it stays in the server.cfg

First we'll have to navigate to the server.cfg file found in /garrysmod/cfg/server.cfg.
You can find it either using SFTP or the Physgun Gamepanel File Manager!

Go ahead and open the file and inside you should see an option named sv_password this is the option we'll edit to add a password.
To edit the password simply add anything inside the quotes such as sv_password "verysecurepassword" and then save the file.

Setting the password using the Physgun File Manager

To remove a password simply leave the quotes empty, it will look like this: sv_password ""

Temporary password


Temporary password means after the server restarts the password will no longer be on the server, this is done by using a command instead of using the server.cfg

Setting a temporary password is very easy, simply navigate to the Physgun Gamepanel Console.
Once you are in the console type sv_password "anything here"
Press enter and your temporary password will be applied!

Setting a temporary password in the Console

Note: After a server restart the password will reset back to whatever it is in the server.cfg

You're done!


Whether you used the temporary password or permanent password that is all there is to it! Very simple and easy to do!

Tip: You can see the servers password by typing only sv_password into the console

Updated on: 20/04/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!