The invention discloses a spindle sealing method for a motor working under a high-temperature or high-pressure environment, which belongs to the technical field of motor equipment. The spindle sealing method is characterized in that a piston rod and a piston are first fitted between a motor housing and a spindle, and a piston end cover is fitted; a first sealing element is fitted on a first connector, and a second sealing element is fitted between a second connector and the spindle; the first connector is connected with the motor housing, the second connector is connected with the first connector, a transitional cavity is formed by the first connector, the second connector and the spindle, an internal cavity is formed by the motor housing, the spindle and the piston end cover, a first pressure balance hole is formed in the first connector, a second pressure balance hole is formed in the piston end cover, and the pressure balance between the transitional cavity and the internal cavity is regulated by means of the motion of the piston. Double sealing is adopted by the invention, the stable operation of the motor can be effectively ensured by the piston balancing the pressure difference between sealing, and the sealing method is simple and reliable.