His latest response shows real teeth, chiefly in the form of sanctions on Russia’s two leading intelligence services, the F.S.B. and GRU, including four top officers of the military intelligence unit who the White House believes ordered those attacks. Mr. Obama also placed sanctions against a number of other individuals and companies, such as the Special Technology Center, which conducts signal intelligence.

Mr. Obama also expelled 35 Russian intelligence operatives and barred Russian diplomats from using two recreational compounds in the United States. The White House said this action was specifically in response to a two-year pattern of harassment of American diplomats in Russia by Kremlin security personnel.

Mr. Obama should have retaliated against this treatment a long time ago; still, the expulsion adds to the severity of the American response and directly affects Russian citizens, whereas the travel bans and asset freezes imposed by the sanctions may not. Russian intelligence officials rarely travel to the United States or stash their assets here. Sanctions imposed by the United States and Europe over Russia’s annexation of Crimea and the war in Ukraine have been in place for two years, yet it is debatable how much effect they have had on Mr. Putin. There is thus a legitimate question about whether Mr. Obama’s penalties will be sufficient. Already Moscow is threatening retaliation.

Mr. Obama is in a tricky place. He has been concerned, rightly so, about tailoring a response that imposes costs on Russia and acts as a deterrent to further Russian attacks without escalating a cyberwar. At the same time, he would be wise to explore possible covert actions that would reinforce his public responses to further drive home the point that attacks on American elections, by Russia or any other country, cannot and will not be tolerated. One such action, some have suggested, would be to leak detailed information about Mr. Putin’s vast wealth, which could undermine his credibility with the Russian people.