Two-dimensional (2D) materials have rich and unique functional properties, but many are susceptible to corrosion under ambient conditions. Here we show that linear alkylamines n-CmH2m+1NH2, with m = 4 to 11, are highly effective in protecting the optoelectronic properties of 2D materials such as black phosphorous (BP) and transition metal dichalcogenides (TMDs: WS2, 1T’-MoTe2, WTe2, WSe2, TaS2, and NbSe2). The material lifetime of BP is prolonged from a few hours to several months. As a representative example, n-hexylamine (m = 6) can be applied easily in the form of self-assembled ~1 nm coatings on BP and its devices to effectively preserve their optoelectronic properties under extended exposure to air, H2O, and even H2O2. The coating is also stable under air or H2 heating and stable in organic solvents, but can be removed by certain organic acids in a reversible manner.