The White House declined to comment on Mr. Shaub.

The Office of Government Ethics is not usually a breeding ground for political stardom — or conflict. Set up in the aftermath of the Watergate scandal, its job is to work with a network of ethics offices in federal agencies to oversee ethical standards for 2.7 million civilian government employees. This means examining financial disclosure reports issued by political employees, to help these new hires decide which assets they must sell to avoid a conflict of interest. The office also helps ensure that once new political employees are hired, they honor restrictions from participating in deliberations over topics they handled for paying clients.

Though the president is not strictly beholden to those laws, the ethics office has always relied on support from the top to send a message to the rest of the federal work force that its program needs to be taken seriously. The office, agency veterans say, has long prided itself on being nonpartisan, not least because its effective operation depends on strong relationships with whichever party is in the White House.

The son of a government chemist, Mr. Shaub grew up in the Washington suburbs with a sense that whatever he chose to do, it ought to entail public service. An interest in ethics only came later, after degrees in history at James Madison University and law at American University. (Two decades later, his own financial disclosure forms show, Mr. Shaub is still paying off student debt.)

In a city where the line between work and socializing often blurs, Mr. Shaub has mostly kept his worlds separate. His interests tend toward the geeky, friends say, like zombie stories and film noir. “He would enjoy puns, especially ones where people would just groan,” said Don Fox, a longtime top agency official. Pop culture, with the possible exception of Harry Potter stories, less so.

“He speaks loudly. He tells funny jokes. He rushes up and down the hall,” said Marilyn Glynn, who hired Mr. Shaub in 2001 and helped recruit him back to the agency in 2006 after a brief stint in the private sector. “You can’t miss him. It’s like a little bit of a hurricane in the office.”

It was in 2006 that Mr. Shaub first began formally working on ethics issues, overseeing the office’s program guiding 1,100 or so presidential nominees through legally required financial disclosures. He turned the program around, writing standardized handbooks to speed up a typically ornery process and developed a reputation among Democrats and Republicans in the White House as a stern, but highly proficient, steward.

“I’d call him up on a Thursday or Friday night and say we need to get this done over the weekend, and he would get the ethics lawyers and the agencies to stay and get it done,” said Richard W. Painter, who served as ethics counsel for the George W. Bush White House. He has vocally defended Mr. Shaub’s approach in recent months.