The quick answer...upgrade to 7.0 and turn off anonymous viewing of profiles in the control panel
The other answer would be, in versions other than 7.0 it would take a modification to the showprofile script. You'd need to put a check in there to see if the user was logged in, and if not give them a message they need to login first.