A Milford man was sentenced to 18 years in prison Thursday for fatally shooting a fellow rooming house resident in 2022 with an untraceable ghost gun.