iMac USB Ports Stopped Working I have an iMac, and because I program I prefer to use the extended USB keyboard.

Just as the batteries to my wireless mouse died, my USB keyboard inexplicably stopped working.  I've been using this keyboard for months through previous mouse battery failures without incident.

Here's what I've observed:


The USB keyboard works fine when connected to my MacBook Pro. (The keyboard works.)
My iPhone charges when connected to the USB ports of the iMac. (The USB ports work.)
The USB keyboard works fine when connect to the USB port of my secondary Thunderbolt display, but only one of the three ports. (?)
When the USB keyboard is connected directly to the iMac, sudo dmesg produces two lines like this:

AppleUSBHubPort[...]::FatalError - Port 2 of Hub at ... reported error ... 
while doing setting port power



Where's what didn't work:


Rebooting in safe mode: sudo nvram boot-args="-x"
Deleting the Bluetooth wireless keyboard device and rebooting
Rebooting while holding Command-Option-P-R


I have an iMac running OS X 10.8.2 with a secondary Thunderbolt display.
Hinted by similar discussions in related forums, I figure it's bad contacts.
I fixed my issue by gently squeezing the keyboard USB to make it tighter. Be careful not to break it though. Just a gentle squeeze, so that it's about 0.5-1mm tighter should be all that's needed.

This would explain why new keyboards work fine for a while and why extension cords only help for a while only as well.