The invention discloses indole compounds represented by the general formula defined in the specification and salts and preparation method thereof, corresponding medical uses of the compounds and the salts thereof, and drugs and disinfectants containing the compounds and the salts thereof. A lot of experiments prove that the compounds and the salts thereof have good bacteriostatic and bactericidal activity on MRSA (drug-resistant staphylococcus aureus), MDR K.pneumonia (drug-resistant klebsiella pneumonia), and MDR A.baumanii (drug-resistant acinetobacter baumannii). In the formula, X is methylene, carbonyl or sulfonyl; R1 is fluorine, chlorine, bromine, methoxy acyl, nitro or hydrogen; R2 is methoxyl acyl, (p-methoxyl acyl)phenyl, (p-trifluoro oxy)phenyl, (p-trifluoro)phenyl, (m-methoxy acyl)phenyl, (m-trifluoro oxy)phenyl, (p-fluoro m-chloro)phenyl or hydrogen; and HA is inorganic acid or a part of organic acid with strong acidity, preferably hydrochloric acid or hydrobromic acid.