In his first month as President Trump’s chief of staff, John F. Kelly has brought discipline to the White House, sometimes to the frustration of Trump. (Bastien Inzaurralde/The Washington Post)

In his first month as President Trump’s chief of staff, John F. Kelly has brought discipline to the White House, sometimes to the frustration of Trump. (Bastien Inzaurralde/The Washington Post)

President Trump spent the final days of August dutifully performing his job. He tended to the massive recovery from Hurricane Harvey. He hit the road to sell his tax-cut plan. And he convened policy meetings on the federal budget and the North Korean nuclear threat.

Behind the scenes during a summer of crisis, however, Trump appears to pine for the days when the Oval Office was a bustling hub of visitors and gossip, over which he presided as impresario. He fumes that he does not get the credit he thinks he deserves from the media or the allegiance from fellow Republican leaders he says he is owed. He boasts about his presidency in superlatives, but confidants privately fret about his suddenly dark moods.

And some of Trump’s friends fear that the short-tempered president is on an inevitable collision course with White House Chief of Staff John F. Kelly.

Trump chafes at some of the retired Marine Corps general’s moves to restrict access to him since he took the job almost a month ago, said several people close to the president. They run counter to Trump’s love of spontaneity and brashness, prompting some Trump loyalists to derisively dub Kelly “the church lady” because they consider him strict and morally superior.

“He’s having a very hard time,” one friend who spoke with Trump this week said of the president. “He doesn’t like the way the media’s handling him. He doesn’t like how Kelly’s handling him. He’s turning on people that are very close to him.”

President Trump's chief of staff John F. Kelly has a long military career but limited experience in politics. Here's how he rose to a top political position. (Amber Ferguson/The Washington Post)

Aides say Trump admires Kelly’s credentials, respects his leadership and management skills, and praises him often, both in private meetings and at public events. In a tax policy speech Wednesday in Missouri, Trump singled out Kelly’s work to decrease the number of illegal border crossings when he was secretary of homeland security.

Meanwhile, people close to the president said he is simmering with displeasure over what he considers personal disloyalty from National Economic Council Director Gary Cohn, who criticized Trump’s responses to a deadly white supremacist rally in Charlottesville on Aug. 12. He also has grown increasingly frustrated with Secretary of State Rex Tillerson, who has clashed with the president on issues including Afghanistan troop levels, the blockade on Qatar and Cuba policy.

This portrait of Trump as he enters what could be his most consequential month in office is based on interviews with 15 senior White House officials, outside advisers and friends of the president, many of whom spoke on the condition of anonymity to be candid.

In September, Trump will face deadlines to raise the federal debt ceiling and pass a spending bill possibly tied to his campaign promise to build a wall along the U.S.-Mexico border; make his first big push for tax cuts; and oversee a potentially historic disaster recovery in Texas and Louisiana.

If Trump’s 75-minute rally performance on Aug. 22 in Phoenix served as a public testimonial to his rage over the media and Congress, he is agitating privately about other concerns, as well.

[As Trump ranted and rambled in Phoenix, his crowd slowly thinned]

Trump lashed out at George Gigicos, one of his original campaign staff members, for what the president considered unflattering television camera angles at the Phoenix rally, which Bloomberg News first reported. The president also was distressed by a New York Times report that was posted a few hours before the event documenting the turmoil between him and Senate Majority Leader Mitch McConnell (R-Ky.).

National Economic Council Director Gary Cohn stands at the North Portico of the White House before President Trump travels to Iowa on June 21. (Jabin Botsford/The Washington Post)

Trump was especially angered by something he learned at his stop earlier in the day, a border visit in Yuma, Ariz., several of his associates said.

A group of Border Patrol agents who had endorsed him and become campaign-trail buddies initially were blocked by the Trump administration from attending. Although the agents eventually were allowed into the event, the president made his displeasure about their treatment known to Kelly, said people who were briefed about the incident. Two of those people said Trump raised his voice with his chief of staff, whom he faulted for trying to restrict outside friends from having direct access to him.

That evening in Phoenix, Trump attempted to call Kelly onto the stage. “Where’s John?” he asked. “Where is he? Where’s General Kelly? Get him out here. He’s great. He’s doing a great job.”

Kelly did not join his boss in front of the crowd.

“It is not unusual for staffers to hear him bluster about things,” said Barry Bennett, a former campaign adviser. “That doesn’t mean it’s real. There were people on the campaign staff that he said to fire a dozen times, but he never did it. It was just bark. And some people don’t know the difference between the bark and the bite.”

Kelly took the job with the express goal of implementing strict order in a West Wing that had become rife with turmoil, infighting and damaging leaks to the media.

[Trump enlists Kelly to enforce order, but can the ‘zoo’ be tamed?]

Friends used to be able to call the White House and be patched directly through to Trump; now those calls are routed through Kelly and do not always make it to the president. Friends used to drop by the West Wing when they had time to kill, wandering to the Oval Office to say hello; now they must have an official appointment — and a clear reason — to visit.

The changes are largely welcomed by senior administration officials, who say the president’s time is too valuable to be wasted on chitchat and hangers-on.

But Trump sometimes defies — and even resents — the new structure. He has been especially sensitive to the way Kelly’s rigid structure is portrayed in the media and strives to disabuse people of the notion that he is being managed. The president continues to call business friends and outside advisers, including former chief strategist Stephen K. Bannon, from his personal phone when Kelly is not around, said people with knowledge of the calls.

“Donald Trump resists being handled,” said Roger Stone, a former Trump adviser and longtime confidant. “Nobody tells him who to see, who to listen to, what to read, what he can say.” Stone added, “General Kelly is trying to treat the president like a mushroom. Keeping him in the dark and feeding him s--- is not going to work. Donald Trump is a free spirit.”

Kelly has told colleagues that he has no intention of controlling what Trump says or tweets. Although he has tried to manage the information the president receives, Kelly recognizes that there are limits to what he can do, according to White House officials.

“The president can turn on the television, the president can call people, and the president can read the newspaper,” said a Republican close to the White House who added that the onus is on Trump, not his staff, to control his impulses.

Trump has jettisoned some of the more controversial figures in his administration this summer. For instance, the firing of Communications Director Anthony Scaramucci after just 10 days earned the flamboyant aide the moniker “suicide bomber” in the West Wing for having taken down with him Chief of Staff Reince Priebus and press secretary Sean Spicer. Trump also parted ways with Bannon, who often channeled the president’s nationalist instincts.

More changes may be afoot under Kelly, who is continuing his personnel review and is said to be targeting aides without clear portfolios of responsibility.

On Tillerson, Trump has come to see his top diplomat’s approach to world affairs as “totally establishment,” in the words of one Trump associate. Several people close to Trump said they would be surprised if Tillerson stays in his post past his one-year mark in January. They hinted that his departure may come far sooner, with one describing it as “imminent.”

And some who have recently seen Tillerson say the former ExxonMobil chief executive — unaccustomed to taking orders from a superior, let alone one as capricious as Trump — also seems to be ready to end his State Department tenure. He has grumbled privately to Kelly about Trump’s recent controversies, said two people familiar with their relationship.

Others, however, caution that Tillerson remains fully enmeshed in the administration. After having lunch with the president Monday, Tillerson sat in the front row of Trump’s joint news conference with the president of Finland and was a key member of Cabinet discussions focused on handling Hurricane Harvey.

White House press secretary Sarah Huckabee Sanders told reporters Wednesday that Trump “absolutely” has confidence in Tillerson.

[Public rifts between Trump and some senior officials widen in the wake of Charlottesville]

Tillerson made headlines over the weekend when he was asked on “Fox News Sunday,” in the context of Charlottesville, whether Trump speaks for American values. “The president speaks for himself,” Tillerson told anchor Chris Wallace.

Many Trump insiders were aghast at the diplomat’s apparent denunciation of the president, but several senior White House officials said Trump’s frustration with Tillerson has been about specific policies. The Fox interview did not bother Trump, one official said, even though the president was upset about Cohn’s scolding of him to the Financial Times.

Trump was especially upset that Cohn went public with his complaints about the president’s handling of Charlottesville, even after Trump listened to Cohn vent during a private meeting on Aug. 18 in Bedminster, N.J.

The president has been quietly fuming about Cohn for the past week but has resisted dismissing him in part because he has been the face, along with Treasury Secretary Steven Mnuchin, of the administration’s tax-cut strategy.

Still, Trump has other ways to slight Cohn. The economic adviser traveled with Trump on Wednesday to Springfield, Mo., for his speech about tax reform, yet when the president ticked through “the many distinguished guests” in attendance, he did not mention Cohn. Afterward, Ivanka Trump, the president’s daughter, tweeted a call for tax reform with a picture of Trump backstage flanked by her and Mnuchin. Notably absent was Cohn, the plan’s co-architect.

Asked about the perceived insults, Sanders told reporters aboard Air Force One on the flight home to Washington that it was “pretty standard tactics” for Trump not to call out staff members in his remarks.

Pressed on the state of Trump and Cohn’s relationship, Sanders said only that both men are committed to tax reform.

“Well, look,” she said, “Gary is here. The president is here.”

Robert Costa, Anne Gearan and Carol D. Leonnig contributed to this report.