Another option is pmsetpmset. Use the command pmset noidle to prevent sleep as long as pmset is running. Unfortunately, it requires a separate Terminal window with pmset running in it. However, the other option, caffeinatecaffeinate, only lets you set a certain time. So it's a matter of choosing whether you want to open a second SSH session, or deal with a time restraint.
Edit: According to binarybob's comment, you can actually run it in the background like this: pmset noidle & To get back to pmset type fg.