WASHINGTON — President Obama has said he wants eventually to scale back drone strikes and steer the country away from a single-minded focus on counterterrorism. But in response to a vague yet ominous terror warning in recent days, his administration shut down nearly two dozen American embassies and consulates and waged an intense drone campaign in Yemen.

American officials speak of the need for vigorous debate about controversial National Security Agency programs revealed by Edward J. Snowden, and Mr. Obama on Friday promised greater accountability to keep the surveillance state in check. Yet his underlying message was clear: the expansive monitoring of telephone and electronic communications would continue because the safety of the country depended on it.

America’s war on terrorism may one day end, as Mr. Obama said in a speech in May, but until that happens the president has given every indication that it will be fought in much the same way it has for nearly 12 years. Even Mr. Obama’s promise of more transparency appeared to fail an instant test during his Friday news conference. Asked about the flurry of American drone strikes in Yemen, which have been reported by every news outlet, Mr. Obama demurred.

“I will not have a discussion about operational issues,” he said.

Mr. Obama, who ran for office in 2008 against what he described as the excesses of counterterrorism under President George W. Bush, has occasionally expressed ambivalence about drone strikes and aggressive surveillance. But with Republicans ever ready to pounce with accusations that he has made the country less safe, he has declined to abandon any of the tools used by his predecessor, with the sole exception of the brutal interrogation methods once used by the C.I.A.