Froome's teammate, Michal Kwiatkowski, placed second, one second slower than Bodnar.
Three-time Tour victor Froome leads by just 18 seconds from Italian national champion Fabio Aru, 23 seconds from Frenchman Romain Bardet and 29 seconds from Colombian Rigoberto Uran - the closest the Tour has ever been at this stage.
Two years ago on a 17.3km course with two climbs, Bardet beat Froome by 10 seconds in a time-trial - this one is 5km longer but has only one climb, and one that suits Froome. We've got a track record of delivering profits [in property] and people know us for that, but now they say 'oh, you're in that team that is doing well in the Tour de France too.' So it is validation in a way. "I'll do my maximum for sure", he said.
"This is fantastic. The team helped me a lot before the break went away". I really wanted to come here and take this jersey and to pull it off is absolutely fantastic.
Chris Froome will take his narrow Tour de France lead into the Alps on Wednesday after defending it through fierce crosswinds on the road to Romans-sur-Isere.
"I didn't think it would come down to this TT in Marseille", Froome said.
Australian Michael Matthews is all but mathematically the green sprinters' points jersey victor - he needs either a single point on Friday or for Andre Greipel to fail to take maximum points in order to win.
"I certainly have a new-found appreciation for just how hard it was for those guys to have won five Tour titles, it certainly isn't getting easier and this year was the closest race of my Tour de France career", he said.
The sprinters have saved their legs for the final time trial of the tour, but all eyes will be on Froome as he crosses the line.
World time trial champion Tony Martin (Katusha-Alpecin) could only ride to fourth place, 14 seconds down on Bodnar, who pulled out all the stops on a course that started and finished in the Stade Velodrome, and featured cobbles, a steep double-digit climb and a parade along the Mediterranean seafront.
Colombian rider Rigoberto Uran moved into second place in the general classification, 54 seconds behind Froome (83 hours, 55 minutes, 16 seconds).
The yellow skinsuit provided by organizers does not include the aerodynamic vortex technology that created controversy in the opening time trial in Duesseldorf.
Bardet has impressed with his inventiveness and guile but he simply hasn't had the strength to make a significant dent in Froome's armor.
We had a tough start at the Tour this year and this victory goes also to Peter [Sagan] and Rafal [Majka].
"I was hunting for opportunities, and then the roundabout arrived", he said. "We're in battle mode, but I let myself down".