Motivated by the first image of a black hole captured by the Event Horizon Telescope (EHT), there has been a surge of research using observations of black hole shadows to test theories of gravity. In this paper, we carry out a study related to the shadow of Kerr black holes surrounded by a cloud of strings in Rastall gravity, which deviates from the Kerr black hole due to the presence of the string parameter a0 and the parameter β. The horizons, ergospheres, and photon region of the black hole are shown. Moreover, we explore the shadow and observations of the black hole, which are closely linked to the parameters a0 and β. By treating M87* as a Kerr black hole surrounded by a cloud of strings under Rastall gravity, we constrain the black hole parameters using the EHT observations. For a given β, the circularity deviation of the black hole obeys ΔC≲0.1 in all regions. The angular diameter θd=42±3μas provides the upper bound of parameters a and a0 for fixed β. The shadow axis ratio satisfies the observation data of EHT (1<Dx≲4/3) in the whole space for a given β. These results are consistent with the public information from EHT. In other words, candidates for real astrophysical black holes can be Kerr black holes surrounded by a cloud of strings in Rastall gravity.