Cationic antimicrobial peptides (CAMPs) serve as the first line of defense of the innate immune system against invading microbial pathogens. Gram-positive bacteria can resist CAMPs by modifying their anionic teichoic acids (TAs) with D-alanine, but the exact mechanism of resistance is not fully understood. Here, we utilized various functional and biophysical approaches to investigate the interactions of the human pathogen Group B Streptococcus (GBS) with a series of CAMPs having different properties. The data reveal that: (i) D-alanylation of lipoteichoic acids (LTAs) enhance GBS resistance only to a subset of CAMPs and there is a direct correlation between resistance and CAMPs length and charge density; (ii) resistance due to reduced anionic charge of LTAs is not attributed to decreased amounts of bound peptides to the bacteria; and (iii) D-alanylation most probably alters the conformation of LTAs which results in increasing the cell wall density, as seen by Transmission Electron Microscopy, and reduces the penetration of CAMPs through the cell wall. Furthermore, Atomic Force Microscopy reveals increased surface rigidity of the cell wall of the wild-type GBS strain to more than 20-fold that of the dltA mutant. We propose that D-alanylation of LTAs confers protection against linear CAMPs mainly by decreasing the flexibility and permeability of the cell wall, rather than by reducing the electrostatic interactions of the peptide with the cell surface. Overall, our findings uncover an important protective role of the cell wall against CAMPs and extend our understanding of mechanisms of bacterial resistance.