Although bacterial pili are known to mediate cell adhesion to a variety of substrates, the molecular interactions behind this process are poorly understood. We report the direct measurement of the forces guiding pili-mediated adhesion, focusing on the medically important probiotic bacterium Lactobacillus rhamnosus GG (LGG). Using non-invasive single-cell force spectroscopy (SCFS), we quantify the adhesion forces between individual bacteria and biotic (mucin, intestinal cells) or abiotic (hydrophobic monolayers) surfaces. On hydrophobic surfaces, bacterial pili strengthen adhesion through remarkable nanospring properties, which - presumably - enable the bacteria to resist high shear forces under physiological conditions. On mucin, nanosprings are more frequent and adhesion forces larger, reflecting the influence of specific pili-mucin bonds. Interestingly, these mechanical responses are no longer observed on human intestinal Caco-2 cells. Rather, force curves exhibit constant force plateaus with extended ruptures reflecting the extraction of membrane nanotethers. These single-cell analyses provide novel insights into the molecular mechanisms by which piliated bacteria colonize surfaces (nanosprings, nanotethers), and offer exciting avenues in nanomedicine for understanding and controlling the adhesion of microbial cells (probiotics, pathogens).