I want to disable suspend because my VPS goes into suspend and I cannot access it.

How I can do that?

  • Hibernate or suspend? Hibernation is disabled by default. – You'reAGitForNotUsingGit Mar 15 '16 at 15:16
  • Oh really? Maybe i should refer to suspend. Anyway i refered how to edit the config, if exists. Thanks a lot. – Fran Rosales Mar 15 '16 at 15:21

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
| improve this answer | |

You can use gconf-editor

install that with

sudo apt-get install gconf-editor

and then look at


Try setting sleep_computer_ac to 0

maybe help

| improve this answer | |
  • gnome? on a server? – Pilot6 Mar 15 '16 at 15:21
  • Hello, It needs a display or a GUI, my server don't have it. There is some else way to edit that? – Fran Rosales Mar 15 '16 at 15:50

This could have to do with that you are trying to run a bash script and that when you close your terminal it just quits this script, this is quite easy to solve.
Step 1 (install screen if not already installed)
sudo apt-get install screen

Step 2 (using it!)
Now before you run your script just run screen!

If you want to get back to it later try running screen -R
I hope this helped!

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.