Wikipedia says, the president is the commander-in-chief, if I understand correctly, he delegates to the secretary of defense, who commands the military.
This certainly sounds like there is nothing the military can (legally) do against the president. They basically have to obey him.
Is there a legal way for the military to disobey? Have there been any precedences of the military going against the president, apart from outright coup?
UCMJ is very strict. Lawful orders must be followed. Unlawful orders should not be followed. When you enter the military, the oath you take is to the US Constitution, not to any person. Unlawful orders are those that violate the US Constitution.
It is pretty simple. You get orders. You follow those orders. Unlawful orders are virtually non-existent in practice.
Ohhh - I had no idea you were an expert on the UCMJ and military law. /s
I kind of think both you guys are agreeing here without even realizing it.
Only the highest ranks of the military have to deal with treasonous presidents, etc. Guess what? There are laws and regulations to deal with that situation as well. Hopefully, the top military leaders are in the process of protecting the US constitution from an illegitimate, belligerent civilian government right now - and are following the rules and regulations that apply. Otherwise, it would be a military coup.
The point is - everyone else except those top ranking leaders just follow the orders in their chain of command - as long as those orders are lawful. In practice, they are lawful pretty much 100% of the time.
In the years that I served, I never heard of anyone refusing to follow unlawful orders, for example. That does not mean it never happens, but it is very rare.
I will add that an "unlawful" order is one that disobeys the law, hence "unlawful." That is ANY law.
Illegal, immoral, or unethical orders. Are orders you do not have to follow because the are unlawful orders.