Ben Botica kicked 20 points on his first Heineken Cup start for Quins, while his half-back partner Danny Care was crowned man-of-the-match after scoring two crucial tries.
Care slipped through in the 31st and 38th minutes to get the English champions back on the rails after they had fallen 19-9 behind.
But despite the best efforts of Connacht's new general Dan Parks, who kicked 17 points, Quins maintained their advantage and denied the hosts a losing bonus point.
Speaking afterwards, O'Shea said: "We are very comfortable to have nine points (after our first two pool matches). To have denied both Biarritz and Connacht a losing bonus point is a huge thing.
"We have put ourselves in a very good position, but we learned a lesson two weeks ago in Exeter. If we mess around and don't come with our 'game heads' on, any team can do a job and we want to do a job in six or eight weeks' time (against Zebre)."
With Care's try double before the break, there was a sense that Quins might kick on with the wind behind them. However, O'Shea was mindful of what a difficult place Galway can be to get a win at.
"Do you come here and have an easy ride? I have been coming here all my life and you don't," he admitted.
"When a team base a lot of their season around one match, you see the build-up around it, you feel the crowd and you give them that bit of energy by getting your defensive line wrong in the first try - well, you are going to be in a game."
O'Shea praised young outside-half Botica who has stepped into the big shoes of Nick Evans in recent weeks, kicking well against both Biarritz and Connacht.
"We have learned a lot. Ben Botica did well in a hostile environment. You learn more about guys away from home and he was very composed, maybe could have kicked more in the second half, but it's not the DNA of the team."
He added: "Connacht will challenge you and at the end of this pool when Biarritz have to come here, this will be one heck of a hard place for Biarritz to come."
Meanwhile, Connacht head coach Eric Elwood was left to rue that 11-minute spell before half-time during which Quins scored 15 points without reply.
"We were leading 19-9 at that stage and they got 15 unanswered points. One of them (the Care tries) was a soft set piece try. They are a good side and once you give them the ball they are just so good," he said.
"At half-time it was 65-35 per cent possession and you cannot give teams like Harlequins that amount of possession.
"We had a plan that we wanted to attack from deep - there is no point kicking to a team like Harlequins.
"It was a full house and we wanted to challenge them and we showed that with the possession in the first half. Unfortunately we did not get enough in the second half."
Elwood felt his side deserved a losing bonus point for their collective efforts, the highlight of which was a superb early try from young centre David McSharry.
"We fought to the bitter end. The only thing I am disappointed with is that we got nothing out of the game - a bonus point would have been something for their efforts tonight."
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.