You can set max players with the command
/set maxclients x
However, the minimum you can actually set it to is 4, so that would be a no.
You can set a password though, the command is /passwd pass to make it password protected and /pass pass to enter using the password. Other people will still be able to join and spectate, but they wont be able to talk or play.