Shaw slotted home in the 51st minute to hand Neil Warnock's side their first home league win in 2005 and provide the Blades with a welcome victory as they prepare for a FA Cup replay with Arsenal.
In his programme notes, Neil Warnock had called on his United players to forget about the impending replay with the Gunners and regain their early season promise in the league.
But his players must have not been listening as they again turned in a thoroughly unconvincing display.
Rotherham meanwhile have now gone eight games without a win and are still looking for their first victory at Bramall Lane since 1980.
Neither side created any fluidity in a scrappy opening 10 minutes despite Warnock making five changes to the side that crashed 3-0 at Plymouth in midweek.
Blades keeper Phil Barnes, in for the injured Paddy Kenny, had to be sharp to clear from the on-rushing Martin Butler after seven minutes, before Alan Quinn blasted a promising free-kick into the Millers' wall moments later.
The patchy standard continued as the half progressed, with both sides looking desperately short on confidence.
After 27 minutes, Will Hoskins was in the action, this time latching on to a Butler through ball. However, Kozluk was alive to the danger and cleared well, drifting across from right-back.
The hosts responded well and soon created the best chance of the half. Michael Tonge, enjoying plenty of space down the hosts' left did well to create room for a cross on 33 minutes but United striker Shaw pulled his weak shot on to the post with Mike Pollitt beaten.
After leaving the field to a chorus of boos at the interval, the hosts started the second half much more brightly.
After some crisp passing in the final third, Quinn slammed a shot over the bar before the Blades surged into the lead moments later.
Phil Jagielka nodded the ball forward from midfield in the 51st minute, allowing Shaw to force his way past Millers' skipper Phil Gilchrist and slot home past Pollitt.
With the Bramall Lane faithful brought to life, Warnock's side pushed forward looking for a second and were unlucky not to double their advantage after 59 minutes.
The lively Quinn broke free down the left before sending in a dangerous low cross that the sliding Shaw missed by inches.
Warnock made a double substitution as the Blades assumed control of the game. Luke Beckett came on for Andy Gray with Andy Liddell replacing Tommy Johnson. And Beckett, recalled from loan at Huddersfield Town, almost made an immediate impact but his close-range header was held on the line by the increasingly under-pressure Pollitt.
Rotherham continued to battle well though, with Hoskins coming close with a 70th minute snap-shot that was again cleared by the covering Kozluk.
But it was the hosts who looked the most likely to grab a second with Jagielka and substitute Steven Kabba, playing his first game for over a year, coming the closest late on.