Project Zomboid allows you to manually create players and only allow them to join the server. Here's how you can configure your server to be whitelisted and only allow players you define to join the server.
1. First, open the Advanced Server Settings
2. Set Open=false
3. Now players will need to have an account created to join the server.
4. To create an account, open the Console tab
5. Run the command addusertowhitelist username password
6. Now the account is created. You can give the username and password to the player you created.