In the Java server, basic options such as port, game mode and whitelist are in the server.properties file. Before editing, shut down the server properly and make a copy of the file.
Step by step
-
Open the
server.propertiesfile in the directory where the server is actually running. If you're using a panel, see if the settings have been rewritten by the panel. -
Change the lines you need. For example,
gamemode=survival,difficulty=normalandwhite-list=true. Edit the existing row instead of adding the same key twice. -
Restart the server and look for warnings in the boot log. If you have opened a whitelist, verify that you have added your own account to the list from the console.
-
Try the first change with a real player account. If the result is not what you expected, first check that the correct file is being read.
Keep in mind
Bedrock also uses a file with a similar name, but some keys are different. Copying the Java settings file to Bedrock.