Setup operators on Minecraft server [duplicate]

I was wondering how I can change my game difficulty and how to change my game to creative. Every time I type in /gamemode 1 or /gamemode creative it comes up with:

I am sorry but you do not have permission to perform this command. Please contact the server administrators if you believe that this is an error.

I thought this was weird because I am the server administrator.


You need to configure your Minecraft server. From the Minecraft wiki:

Configuring the Minecraft server

  1. Configure the server by editing the server.properties file, the format for which is explained here. Be certain to edit the file with a text editor that does not add formatting (e.g., for italics). Additional configuration may not be necessary as many servers run fine from the default values.

  2. Add your username to the admin.txt and/or ops.txt (newer Minecraft versions may not have an admin.txt file). Ops.txt and admin.txt determine who may execute server commands. In other words, operator ("op") privileges allow you to control certain aspects of the game (e.g., teleporting players). Op privileges may also be granted from the server GUI: type "op " and it will automatically add to the ops.txt file.