President Donald 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 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.”

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 on 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 criticised Trump's responses to a deadly white supremacist rally in Charlottesville, Virginia, on 12 August. 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 share candid assessments.

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 US-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 22 August in Phoenix served as a public testimonial to his rage over the media and Congress, he is agitating privately about other concerns as well.

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, Republican-Kentucky.

Trump was especially angered by something he learned about at his stop earlier in the day, a border visit in Yuma, Arizona, 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 multiple 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 on a West Wing that had become rife with turmoil, infighting and damaging leaks to the media.

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 Steve 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 recognises 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 one Republican close to the White House. This person said 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 channelled 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. Tillerson has grumbled privately to Kelly about Trump's recent controversies, according to two people familiar with their relationship.

Others, however, caution that Tillerson remains fully enmeshed in the administration. After lunching with the President on Monday, Tillerson sat in the front row of Trump's joint press 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 on Wednesday that Trump “absolutely” has confidence in Tillerson.

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 over 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 18 August in Bedminster, New Jersey.

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 travelled with Trump on Wednesday to Springfield, Missouri, for his taxes speech, yet when the president ticked through “the many distinguished guests” in attendance he did not mention Cohn. Afterwards, 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 the plan's co-architect, Cohn.

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 staffers in his remarks.

The aftermath of Hurricane Harvey Show all 19 1 /19 The aftermath of Hurricane Harvey The aftermath of Hurricane Harvey A tattered U.S. flag damaged in Hurricane Harvey, flies in Conroe, Texas Reuters The aftermath of Hurricane Harvey Lisa Rehr holds her four-year old son Maximus, after they lost their home to Hurricane Harvey, as they await to be evacuated with their belongings from Rockport, Texas Reuters The aftermath of Hurricane Harvey People line up for food as others rest at the George R. Brown Convention Center AP Photo/LM Otero The aftermath of Hurricane Harvey Volunteers with The American Red Cross register evacuees at the George R. Brown Convention Center Reuters/Nick Oxford The aftermath of Hurricane Harvey Soldiers with the Texas Army National Guard help the residents of Cyprus Creek Reuters The aftermath of Hurricane Harvey Residents wade through floodwater Reuters/Nick Oxford The aftermath of Hurricane Harvey Residents walk along the flooded roadway of Texas 249 as they evacuate their adjacent neighborhoods EPA The aftermath of Hurricane Harvey A man floats past a truck submerged on a freeway flooded by Tropical Storm Harvey on Sunday AP The aftermath of Hurricane Harvey People are rescued by airboat as they evacuate from flood waters from Hurricane Harvey in Dickinson, Texas Reuters The aftermath of Hurricane Harvey James Archiable carries his bike through the flooded intersection at Taylor and Usenet near downtown Houston, Texas EPA The aftermath of Hurricane Harvey A massive sinkhole opened up on a motorway in Rosenburg, a city 25 miles southwest of Houston, Texas Rosenberg Police The aftermath of Hurricane Harvey People are rescued from flood waters from Hurricane Harvey in an armored police mine-resistant ambush protected vehicle in Dickinson, Texas Reuters The aftermath of Hurricane Harvey People are rescued from flood waters from Hurricane Harvey on a boat in Dickinson, Texas Reuters The aftermath of Hurricane Harvey Evacuees are airlifted in a US Coast Guard helicopter after flooding due to Hurricane Harvey inundated neighborhoods in Houston, Texas Reuters The aftermath of Hurricane Harvey Evacuees leave a US Coast Guard helicopter after being rescued from flooding due to Hurricane Harvey in Houston, Texas Reuters The aftermath of Hurricane Harvey Residents look on at a submerged motorway during a break in the rain in Houston, Texas EPA The aftermath of Hurricane Harvey People photograph the submerged motorway interchange EPA The aftermath of Hurricane Harvey Debris lies on the ground after a building was destroyed by Hurricane Harvey in Aransas Pass, Texas AP The aftermath of Hurricane Harvey Dominic Dominguez searches for his boat in a boat storage facility that was heavily damaged by Hurricane Harvey near Rockport, Texas EPA

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

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