BEYDA, Libya—Underneath a bank in this eastern coastal city, a vault holds a trove of gold and silver coins worth $184 million. It belongs to the central bank, which could use the money to alleviate a crippling cash shortage.

The pile, however, presents some problems. The coins are locked away with a five-number code that central bankers in this part of the country don’t have. A rival government in Tripoli, which has effective control over the bank system, won’t hand over the digits and has expressed concern the money could...