Common account database of two servers

Hey. I need to raise another server, but so that the user accounts between the two are shared. I’m not sure that the active directory is a good solution, because the servers work on the Internet, and not on the local network.

Is there a solution?