The United States edged closer yesterday to accepting the deposed shah of Iran in this country permanently by acknowledging he can remain here if he has no other place to go.

"We're not going to put a man out in a row boat. We're not going to send a man out of this country into nothingness," said State Department spokesman Hodding Carter in response to questions about increased U.S. responsibility for the former monarch, now convalescing at a U.S. Air Force base in San Antonio, Tex.

Officials emphasized that no governmental decision has been made to provide permanent sanctuary to Mohammad Reza Pahlavi, his wife and entourage. However, statements accepting a U.S. posture as a haven of last resort may diminish the pressures on other nations to provide a temporary or permanent home for the deposed shah.

Egyptian President Anwar Sadat has expressed his willingness to accept the shah. Some U.S. officials as well as members of Congress fear that Pahlavi's presence in Egypt could bring serious trouble to Sadat, a vitally important Middle Eastern ally. But official sources insisted that the shah's departure for Egypt or any other country would be strictly the decision of the former monarch and his potential host.

The State Department's Carter, in a briefing for reporters, described the shift in U.S. statements about the shah's future as a reflection of a changed situation. Previously it had been assumed that Pahlavi would return to Mexico after his medical treatments in a New York hospital, but last Thursday Mexico barred his return.

"The United States does not rule out anything for the shah" in the future, Carter said. "It is for the shah to decide where he will go. We're trying to help him" find a place.

Reports from San Antonio said Pahlavi had been moved from hospital quarters in a private ward to more comfortable VIP accommodations at Lackland Air Force Base. The Associated Press quoted a base official as saying that the shah, his wife and entourage are staying at apartments reserved for visiting officers and dignitaries.

There were no briefings or news conferences on Pahlavi's condition or accommodations at the base, and the public affairs officer there said no statements were planned.

About 300 Iranians are enrolled in colleges in San Antonio, a city of 800,000 with four Air Force bases and an Army reservation. Yesterday, a group of Iranians asked the city for permission for an anti-Shah rally outside Lackland's north gate and for a parade through the city. The request is being considered.

Diplomatic activity in the Iranian crisis yesterday continued to focus on the united Nations Security Council. Official sources suggested that additional U.S. decisions and steps in pursuit of a diplomatic solution may follow U.S. action and the results of Iran's constitutional referendum in a day or two.

The United States continued to express strong displeasure with the government of Libya, where a mob invaded the American Emassy Sunday and set a fire on the first floor.

Hodding Carter said the status of U.S. relations with Libya is under "active review" as a result of the attack and the "inadequate" Libyan response to it.

Libya has offered a statement of "regret" about the attack, but has made no offer of compensation and so far has not permitted U.S. diplomats on the scene to take up the problem with Libyan leader Col. Muammar Qaddafi.

The U.S. assumption is that no large demonstration could have been mounted in tightly controlled Libya without government acquiescence or outright approval. One theory is that some level of Libyan officialdom approved the demonstration as a show of solidarity with Iran's Islamic revolutionaries, but that the display turned more violent than expected.

The State Department spokesman continued to make biting remarks about Libya's failure to provide adequate protection for the embassy, despite recent U.S. pleas for such measures. Hodding Carter noted that the Libyan government has given assurances since the attack that remaining Americans will be protected, but added that in view of Libya's past performance, "it is not certain if this will be carried out."

Since Sunday's attack, several American officials have left Libya, along with the rest of the dependents of officials. Only 10 U.S. officials remain, according to Carter. The U.S. staff there has been meeting daily with representatives of the 2,500 to 3,000 American citizens who remain in the country.

Libya is the third-largest supplier of imported oil to the United States. Economic ties between the two countries have grown steadily in recent years even though Washington and Tripoli have been at cross purposes politically.

Despite the importance of Libyan oil, a strong U.S. reaction to Sunday's attack has not been ruled out, and reporters were told that a full range of options, including severance of diplomatic relations, is under study.

Much will depend on Libya's attitudes and actions in the next day or two, according to officials. from a diplomatic and political viewpoint, according to official sources, the United States cannot tolerate a government-sanctioned attack against another American embassy.