A U.S. federal judge on Thursday entered a permanent order of detention for the man suspected of setting off smoke bombs and spraying gunfire inside a New York City subway car this week, after prosecutors said he presented a flight risk and a danger to the community.