Colonel Chukwuemeka Onwuamaegbu told AFP that the ban on leave came into effect last week after President Olusegun Obasanjo's spokeswoman announced a probe into what she called "a serious breach" of national security.
"Since we are in the business of maintaining national security, it makes sense to be able to know where everybody is," he told AFP, adding that it was not yet known for how long the measures would remain in place.
Onwuamaegbu said that some officers, he could not say how many, were still undergoing interrogation after they were "invited for questioning", but denied that this amounted to them being held in detention.
Nigeria has been alive with rumours that disaffected soldiers are plotting to overthrow Obasanjo's rule since April 2, when presidential spokeswoman Remi Oyo announced that a "considerable number" of officers were under suspicion.
"National and military security agencies are investigating what looks like a serious breach of security on the part of some military officers and apparent civilian collaborators," Oyo told reporters.
Nigeria's chief defence spokesman, Colonel Ganiyu Adewale, confirmed that the order restricting personnel to barracks unless on official duties applied to all soldiers, sailors and airmen in the three armed services.
A naval captain told AFP: "We security forces don't take any rumour lightly. We've been banned from leaving our posts and whoever contravenes that order will be arrested and taken as a suspect in this coup rumour."
"Nobody knows, for now, how long this order will last," he told AFP, speaking on condition of anonymity, adding that he personally had been forced to cancel plans to travel home on leave over the Easter holiday weekend.
Officials have so far played down fears that Africa's most populous country -- and the world's sixth largest exporter of crude oil -- is at risk of suffering its sixth military putsch since 1966.
Coup-plot rumours first surfaced last week when Hamza al-Mustapha, former chief of security to the late military dictator Sani Abacha, was taken from a civilian jail by military intelligence agents.
Military sources, including an army general, told AFP that al-Mustapha was suspected of having links to the supposed plot, despite being held on remand on allegations he ordered the 1996 attempted murder of a newspaper publisher.
Al-Mustapha was effectively Abacha's second-in-command during his brutal 1993-1998 reign, and reportedly led a death squad known as the "Strike Force".
He had been due to appear in court last week on the attempted murder charge, but on the eve of the hearing he was whisked away from Lagos' maximum security Kirikiri jail by military intelligence officers.
On Thursday, the judge in his murder trial demanded that he be handed back into civilian custody to face the charge.
Army and navy officers said last week that the majority of the alleged plotters were disaffected mid-ranking officers, most of them like al-Mustapha from the Hausa-speaking people of Nigeria's mainly Muslim north.
Officials have stressed that the alleged plot posed no immediate danger to civilian rule, but any hint that Nigeria might be backsliding into another round of instability will be closely followed by international observers.
The west African giant is Africa's most populous country, with 126 million people, and exports more than two million barrels of crude oil per day, most of it to the United States where pump prices are already at an all-time high.
Nigeria won its independence from Britain in 1960, suffered the first of many military power grabs six years later and has since endured a total of 28 years under various military rulers, including a brutal 30-month civil war.
Despite having Africa's richest oil fields, corruption and military misrule have crippled the economy. In 30 years, the proportion of people living in abject poverty on less than a dollar a day has doubled, to almost 80 percent.
Obasanjo's 1999 election marked the start of what Nigerians still call their latest "democratic experiment". Since then more than 10,000 people have been killed in ethnic and sectarian violence.
Both Obasanjo's re-election in April last year, and last month's local government polls were marred by widespread ballot-rigging and violence.