Greenhouses have become increasingly important for food production and food security. However, our understanding of how greenhouses may contribute to genetic variations in soil microbial populations is very limited. In this study, we obtained and analyzed soil populations of the cosmopolitan fungal pathogen Alternaria alternata in seven greenhouses in Shijiazhuang, northeast China. Our analyses revealed high proportions of isolates being resistant to agricultural triazole fungicides and medical triazole drugs, including cross-resistance to both groups of triazoles. In addition, we found that greenhouse populations of A. alternata located within a few kilometers showed similar levels of genetic differentiation as those separated by over 2,000 km between northeast and southwest China. Our study suggests that greenhouse populations of this and potentially other fungal pathogens represent an important ecological niche and an emerging threat to food security and human health.