Admin Command Setup

From Hopmod Wiki

Jump to: navigation, search

The #admin command is a better security alternative to the /setmaster command. Each member of your "admin team" has their own name and key instead of them all sharing a password. With a shared password, it has to be changed frequently and it's vulnerable to being leaked and there's no accountability. The #admin command shows the admin's true identity. The server owner can revoke a (clan) member's admin privilege without any hassle. It's easier to use. There's no password to remember and you don't have to waste a bind key on a specific login. The only downside to the admin command is it's harder to setup.

Auth configuration

Create a file named auth.lua in the conf directory, this is the place where your auth domain and user information goes.

auth.directory.domain{
    id = "example.com:admin",
    server = "LOCAL"
}

auth.directory.user{
    domain = "example.com:admin",
    id = "graham",
    public_key = "+55fb4d5fbab00c7314cbea8991692dcc6985db3906960aab"
}

Server configuration

You need to set the admin_domain variable and include the admin command in your enable_commands list in server.conf.

admin_domains "example.com:admin"
enable_commands [admin]

Add admin user

Generate a pair of keys using the key generation program located at bin/keygen. The output should look something like this:

d6fa52b1107f8af540e91b021b111001c663895b51e59185
+c36622c67e5a9eb664276c5a668f0f8f7dbf1b3764979cb5

The first line is the private key and the second line is the public key. The server keeps the public key and forgets the private key after giving it to the user. Copy the public key into a new auth.directory.user table in auth.lua.

Make sure the new user has a unique id field.

Example:

auth.directory.user{
    domain = "example.com:admin",
    id = "<ASSIGN UNIQUE NAME>",
    public_key = "+c36622c67e5a9eb664276c5a668f0f8f7dbf1b3764979cb5"
}

Key installation for player

Find and open a file named auth.cfg in your Sauerbraten directory, it should be located in the same directory as config.cfg. If the file doesn't exist create a new file named auth.cfg. Take the private key sent to you by the server admin and include it in a new authkey entry. Make sure the name and domain parameters match those on the server.

authkey "graham" "9c229d9bb0c97bfe9c75a81888ad4507af1261e235dbfd0a" "example.com:admin"