From 1867 to 1869 he was a deputy U.S. Marshall at Fort Riley and an army scout. His duties included recovering stolen government livestock, arresting thieves, returning deserters to the army, and escorting prisoners to Topeka. Buffalo Bill worked with him. In 1867, Wild Bill and other scouts led Custer's 7th Cavalry and other units on the war path against the Cheyenne, Kiowa, and Arapaho, who had been harassing the Overland Stage. Writers also exaggerated this story, contributing to Wild Bill's legend.
In 1868, he was scouting for the 10th Cavalry when he was attacked by a Cheyenne war party. He returned home to Troy Hills to recuperate from a nasty thigh wound. He was 32 at the time. After that he guided the Wilson party for a five week tour of the plains. Senator Wilson gave him $500 and a pair of ivory handled Colts that Wild Bill always wore from then on.
In August 1869, he was appointed sheriff of Ellis County, Kansas. He killed two men there, both seeking to enhance their own reputations by killing Wild Bill. A month later he was given the job of marshal at Hays City, Kansas. He was defeated in the Ellis County election in November, so held just the one position at Hays City after that. While there he took care of three toughs who had been terrorizing the town. One was John Strawan, who Wild Bill gunned down in a saloon. Another was an Irishman who was trying to make a name for himself by shooting Wild Bill. The third was an army man, part of a group of five led by Tom Custer, brother of George Custer, who was out to get Wild Bill for arresting him for disturbing the peace. After that incident, Wild Bill left town.