In letters to Mediterranean governments, Ban said all aid for Gaza, which is blockaded by Israeli forces, should go through "legitimate crossings and established channels" -- which in practice in recent years has meant through Israel.
But he also called on Israel to "act responsibly" to avoid violence.
Activists say it is legal for them to send goods by sea direct to the coastal Gaza Strip. Israel says it is justified in blocking such shipments because Palestinian militants in Gaza, which is run by the Hamas Islamist group, conduct military actions against Israel such as firing rockets.
Ban said in his letters he was concerned by reports that another attempt would be made next month to send an international aid flotilla to Gaza, U.N. spokesman Martin Nesirky said.
"The secretary-general called on all governments concerned to use their influence to discourage such flotillas, which carry the potential to escalate into violent conflict," Nesirky told reporters.
"He further called on all, including the government of Israel, to act responsibly and with caution to avoid any violent incident."
Last May 31, Israeli marines intercepted a six-ship flotilla in international waters and killed nine activists -- eight Turks and a Turkish-American -- aboard the Mavi Marmara, owned by the Turkish Islamic charity IHH.
Israel said its marines were attacked by activists wielding metal bars, clubs and knives. The incident led to a breakdown in already strained ties between Turkey and Israel.
With the anniversary of the incident looming, the Free Gaza Movement, an international pro-Palestinian activists group that includes IHH, is planning for a convoy to set out for Gaza from various parts of Europe, including Turkey.
The movement says on its website that at least 10 ships with doctors, professors, artists and journalists among those on board, as well as construction supplies and humanitarian aid, will set sail in the second half of June.
It describes the move as "an act of non-violent civil disobedience to persuade the international community to fulfill its obligations toward the Palestinian people and end Israel's four-year illegal blockade of Gaza."
Turkish Foreign Minister Ahmet Davutoglu said last week his administration had warned Turkish activists of the risks of trying to break Israel's naval blockade of Gaza, but could not prevent them from sailing, as Israel has requested.
Ban, whose letter did not mention Turkey by name, said that while flotillas were "not helpful," the Gaza situation was unsustainable and Israel should take "further meaningful and far-reaching steps" to end the territory's closure.
Ban last year appointed a panel, headed by former New Zealand Prime Minister Geoffrey Palmer and including a Turkish and an Israeli representative, to look into the Mavi Marmara affair.
The panel's report to Ban has been delayed by disagreements between Turkey and Israel over its findings, diplomats and U.N. officials say.