A legged robot that moves across a steel structure is developed for steel bridge inspection. Powerful permanent magnets imbedded in each foot allow the robot to hang from a steel ceiling powerlessly. Although the magnets are passive, the attractive force is modulated by tilting the foot against the steel surface. This allows the robot to slide its feet along the surface using “moonwalk” and “shuffle” gait patterns. The robot can also detach its feet and “swing” them over small obstacles. These diverse walking patterns are created with a single servoed joint and two sets of simple locking mechanisms. Kinematic and static conditions are obtained for the underactuated legged robot to perform each gait pattern safely and stably. A dynamic model is built for swinging a leg, and a desirable swing trajectory that keeps the foot reaction force lower than its limit is obtained. A proof-of-concept prototype robot is designed, built, and tested. Experiments demonstrate the feasibility of the design concept and verify the analytical results.