Protein palmitoylation, a cellular process occurring at the membrane-cytosol interface, is orchestrated by members of the DHHC enzyme family and plays a pivotal role in regulating various cellular functions. The M2 protein of the influenza virus, which is acylated at a membrane-near amphiphilic helix serves as a model for studying the intricate signals governing acylation and its interaction with the cognate enzyme, DHHC20. We investigate it here using both experimental and computational assays. We report that altering the biophysical properties of the amphiphilic helix, particularly by shortening or disrupting it, results in a substantial reduction in M2 palmitoylation, but does not entirely abolish the process. Intriguingly, DHHC20 exhibits an augmented affinity for some M2 mutants compared to the wildtype M2. Molecular dynamics simulations unveil interactions between amino acids of the helix and the catalytically significant DHHC and TTXE motifs of DHHC20. Our findings suggest that the binding of M2 to DHHC20, while not highly specific, is mediated by requisite contacts, possibly instigating the transfer of fatty acids. A comprehensive comprehension of protein palmitoylation mechanisms is imperative for the development of DHHC-specific inhibitors, holding promise for the treatment of diverse human diseases.