SZOLNOK, Hungary — Secretive, behind-the-lines mission rehearsals and other operations by 1,400 American and allied commandos to combat shifting Russian threats have laid bare a fundamental tension in the Trump administration: While the president courts Moscow, much of his government considers it an increasingly dangerous foe.

Just days before President Trump made light of Russia’s interference in American elections during a meeting last month with President Vladimir V. Putin, teams of Army Green Berets and Navy SEALs were practicing support missions for local resistance forces in Eastern Europe and the Baltics should they have to confront Russian commandos without insignia, the so-called little green men who helped Moscow seize Crimea in 2014.

Under a revamped Pentagon strategy to counter growing threats from Russia and China, American commandos are teaming up with partners on Europe’s eastern flank to thwart Russia’s so-called hybrid warfare, which allied officials say increasingly involves manipulating events using a mix of subterfuge, cyberattacks and information warfare. The threats hark back to Cold War-era intrigue, but so far are being fought with bytes and bandwidth, not bombs and bullets.