ATLANTA — The dilemma confronts city and state officials with alarming frequency: Digital extortionists have hijacked their computer systems and demanded ransom. Should they pay?

It has surfaced in the suburbs of Dallas and in Birmingham, Ala., in North Carolina and in New Mexico, and twice in a matter of weeks at the Colorado Department of Transportation. And for the past week it has gripped Atlanta, where the municipal government has been struggling with one of the gravest cyberattacks on record against a major American city.

The assault on Atlanta’s computers is a vivid example of the perils local governments face in the internet age. They are seen as more vulnerable than private businesses, both in their technology and in their limited ability to tolerate system failures and down time.

“They’re a target of opportunity for criminals, because people feel it’s easier to hack into them than it is private systems and companies,” said Alan R. Shark, the executive director of the Public Technology Institute, which offers training to local governments.