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.
There are two main things that would make connecting to the iMac difficult over VPN, the machine going to sleep being one and being assigned a different IP address over DHCP being the other.
The settings for sleep are stored in the Energy Saver preference pane in System Preferences.
There is a slider for Computer Sleep, slide this to 'Never'. This will mean the machine will never sleep automatically.
There are options for waking over LAN too if you desperately need things to sleep.
If you still experience issues after this you may find that you need to configure a manual IP in the firewall and in the Network preference pane, again in System Preferences.
I don't have a 10.7 system here for screenshots otherwise I'd add some. If someone edits with some or if I get home to grab some that would be ideal.