Consider the two-dimensional inverse elastic scattering problem of recovering a piecewise linear rigid rough or periodic surface of rectangular type for which the neighboring line segments are always perpendicular. We prove the global uniqueness with at most two incident elastic plane waves by using near-field data. If the Lame constants satisfy a certain condition, then the data of a single plane wave is sufficient to imply the uniqueness. Our proof is based on a transcendental equation for the Navier equation, which is derived from the expansion of analytic solutions to the Helmholtz equation. The uniqueness results apply also to an inverse scattering problem for non-convex bounded rigid bodies of rectangular type.