The invention discloses an osamine organic rebar corrosion inhibitor, which is prepared from hemiacetal hydroxyl containing sugar and amine through condensation, wherein the sugar contains hydroxyl protected or unprotected monosaccharides and disaccharides, and is wide in sources, green and environmentally friendly; and the amine is shown in a formula:, wherein R1 and R2 are independently selected from a linear chain containing 1-15 carbons, a branched chain, ring alkyl, aralkyl, aryl, alkenyl, ether alkyl, amino alkyl, alkyl alcohol, alkylamine, an alkyl carboxylic acid or a hydrogen atom, can be cyclized, and can not be a hydrogen atom simultaneously. According to the invention, a synthesis process is simple, and a prepared corrosion inhibitor has the characteristics of efficient corrosion inhibition, green and environmental friendliness, and has a significant application value and a broad market prospect.