In this paper, we study the zero and finite temperature Casimir force acting on a perfectly conducting rectangular piston inside a closed rectangular cavity with infinitely permeable walls. Explicit formulas for the Casimir force are derived. We show that at any temperature, the Casimir force always tends to move the piston away from the walls and towards its equilibrium position. In the high temperature regime, we show that the leading term of the Casimir force is linear in temperature and therefore the Casimir force has a classical limit.