"I think today everyone has accepted that President Assad must remain so that we can combat the terrorists," Rouhani told CNN.
Iran and Russia are the key allies of Assad, who has faced Western demands that he step down amid a war that has killed more than 240,000 people and caused four million to flee.
But the United States has been hitting Islamic State extremists opposed to Assad, with France on Sunday launching its first strike.
"In Syria, when our first objective is to drive out terrorists and combatting terrorists to defeat them, we have no solution other than to strengthen the central authority and the central government of that country as a central seat of power," said Rouhani, who is visiting New York for the UN General Assembly.
Signup to our newsletter and follow us on Facebook and Twitter!
Iran's Shiite clerical regime has voiced concern over a future without Assad, a largely secular leader from the heterodox Alawite movement.
But Rouhani said he also saw a future role for opponents of Assad.
"As soon as this movement reaches the various levels of success and starts driving out the terrorists on a step-by-step basis, then other plans must be put into action so as to hear the voices of the opposition as well," Rouhani said.
The reform-minded Rouhani has reached a landmark denuclearization accord with major powers, a step in reconciliation with the United States, the traditional bugbear of Iran since the 1979 Islamic revolution.
But Rouhani said that Iran was not in direct talks about Syria with the United States.