While configuring my HTPC via SSH, I needed to deactivate its screensaver without having access to its own keyboard or mouse. Here's how to do that from the (SSH) command line:
xscreensaver-command -deactivate
If you happen to use gnome-screensaver (default in Ubuntu), the following command might help (not tested):