Prevent iMac from sleeping, for VPN login?
You can disable sleeping in the Energy Saver preference pane of System Preferences.





Alternatively, you can use a free app called Caffeine to easily prevent your Mac from sleeping just with a click of the mouse.  Both work exactly the same, but Caffeine makes it easier to dynamically switch between the two settings.