The default behavior of Factorio is to allow anybody onto your server, this also applies if a player knows or guesses your server password. It is advisable to whitelist which players can connect to your server to protect from griefers.
Note: If no players are present in your whitelist, anyone can join your server. At least one player must be present for the whitelist to be enforced.
Using ServerFlex
- Go to your server on the Control Panel.
- Click settings in the server navigation bar
- Click whitelist on the left navigation bar
- Enter the username into the input box
- Click Add Player and you're done.
If at any point you wish to open your server publicly simply remove all players from the whitelist and restart your server.