Minecraft server whitelist and operators
Turn on the whitelist, add players, make operators and ban players on a Minecraft Java server, and what whitelist.json and ops.json hold.
Minecraft servers have no password. Who may join is the whitelist, and who runs the server in game are its operators. Both are commands on the server's console, or on the chat for an operator, with a slash.
Turn on the whitelist
Set white-list=true in server.properties, or run whitelist on. With enforce-whitelist=true too, players removed from the list are kicked at once instead of at their next join.
whitelist add Alexlets a player in.whitelist remove Alextakes them off.whitelist listshows who is on it.whitelist reloadreadswhitelist.jsonagain after you edit it by hand.
The server looks each name up with Mojang and saves it with the player's ID in whitelist.json, so a player who changes their name stays on it.
Make someone an operator
op Alex gives a player the server's commands; deop Alex takes them back. Operators are saved in ops.json with a level, 4 by default (op-permission-level): every command, including stop. Lower levels in ops.json give fewer commands.
Kick and ban
kick Alexremoves a player once.ban Alexkeeps them out, saved inbanned-players.json;pardon Alexlets them back.ban-ipandpardon-ipdo the same for an address, inbanned-ips.json.
Editing the files
The server reads the lists at start and rewrites them when they change in game, so stop it before editing them by hand, or use whitelist reload. Each is a JSON list; an empty one is [].
Private servers use the whitelist
A private Minecraft server on HostForge has its whitelist on. The Minecraft name in your settings is made an operator and added for you; the Console tab runs whitelist add, op and the rest, and Configuration files edits the lists.
See also joining a server, or start a free one on HostForge.