A pair of ransomware attacks in Maine on sewage treatment plants in rural communities demonstrates that small towns need to be just as vigilant as larger communities in protecting against hackers, local officials said.

The attacks occurred in April in Mount Desert and on the Fourth of July in Limestone, and no money was paid and no customer data was compromised, officials said Monday.

“It’s like an arms race between the good guys and the bad guys,” said Mount Desert Town Manager Durlin Lunt Jr. “Fortunately, in this case, they didn’t get anything.”

In northern Maine, the town of Limestone was hit on a holiday.

Limestone Water and Sewer District Superintendent Jim Leighton said the control computer was hit with the ransomware attack.

The hackers couldn’t cause harm, but the computer shutdown did take offline alarms to alert workers if pumps overheat or tanks are overfilled, he said.

In the end, the old, obsolete Windows 7 computer was due to be replaced anyway, he said, and it may have been a good thing because it caught the attention of water and sewage district operators in Aroostook County.

“It was a bad thing for us but a good thing for the county,” he said. “Everyone took notice and did things to their computers so they couldn’t be hit.”