I've got an Ubuntu server that boots up in text mode. It rarely has a screen or keyboard attached to it, but when I do attach a screen, I usually have to attach a keyboard too, because the darn console mode screen saver will be on and I'll need to hit a key to see what's going on.

I'm aware that the setterm command can disable this, but it's a per-session thing. How can I make it so the machine never ever blanks the screen in text mode, even when it's first booted up and sitting at the login prompt?


6 Answers 6


In Ubuntu 12.10 and earlier the console-tools package allows console options to be controlled.

To turn off screen blanking and powerdown, set BLANK_TIME and POWERDOWN_TIME to 0 in /etc/console-tools/config. If you'd prefer not to modify the config file, the same effect can be achieved by creating a new file in /etc/console-tools/config.d containing the following:


The name of the file in config.d must consist entirely of upper and lower case letters, digits, underscores, and hyphens.

  • How you know that? I've been scouring the Internet all morning looking for the documentation for /etc/console-tools and haven't been able to find any.
    – raldi
    May 1, 2010 at 21:28
  • 10
    Word of warning with this: I installed console-tools on ubuntu server 12.04, did the above config and it completely tanked it... Not sure what I did wrong, but if it happens to anyone else (and you're crap at servers like me!), boot to recovery -> root prompt -> mount -o remount,rw / -> apt-get remove console-tools -> reboot Sep 20, 2012 at 12:47
  • This does not exist on ubuntu 18.04 :( - any alternatives? Nov 9, 2018 at 19:18

Or you use /etc/kbd/config to set up (depends on your system, what is installed)

  • What do I restart when having KBD config change ?
    – Frodik
    Jan 11, 2012 at 11:24
  • 1
    Seems to be /etc/init.d/kbd reload
    – Vincent
    Apr 25, 2012 at 10:45
  • 2
    I tried this in a fresh install of Ubuntu Server 10.04.4 and 12.04.1, and it didn't work in either one. Sep 22, 2012 at 0:14
  • To what distributions does this apply? Oct 13, 2012 at 4:17
  • This works on Debian 6 and 7. This config file sets BLANK_TIME=30 by default.
    – basic6
    Jul 3, 2015 at 8:29

The parameter is controlled via the kernel command line, using setterm merely alters the runtime settings. To disable it system wide you can alter your kernel boot command line by appending it with "consoleblank=0" in your boot configuration (grub/lilo).

If something during boot setterm's it then it will override the value.

  • 3
    As seen on superuser.com/questions/152347/… !
    – codehead
    Oct 18, 2012 at 13:14
  • Using grub2 it could be added in /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0" and then updating grub config with grub[2]-mkconfig -o /boot/grub/grub.cfg. Or it could be embedded in built-in kernel command line while configuring and compiling kernel manually. Oct 30, 2014 at 7:44

If you add the setterm command to /etc/rc.local, it should take effect for all virtual consoles, whether or not a user is logged into them. E.g.:

setterm -blank 0
  • That doesn't seem to actually work in rc.local.
    – raldi
    May 1, 2010 at 20:09
  • It's worked for me in the past on RedHat-type systems. It could be that Debian/Ubuntu load rc.local at a slightly different time than RH. Sorry about that. May 1, 2010 at 21:33
  • Does not work on CentOS 6.3. Screen continues to blank out after 10 minutes. Oct 13, 2012 at 4:16
  • 1
    I found that this worked for RHEL 5 and 6 (/bin/setterm -blank 0 -powerdown 0 -powersave off), but not for 7. Success or failure probably depends on your distribution and the console environment at the time rc.local is executed.
    – David C.
    Nov 24, 2015 at 17:31
  • I get this < ~$ sudo setterm -blank 0 setterm: terminal xterm-256color does not support --blank Nov 9, 2018 at 19:19

If you are running a newer Ubuntu that uses upstart, you can use:

for file in /etc/init/tty*.conf; do tty="/dev/`basename $file .conf`"; echo "post-start exec setterm -blank 0 -powersave off >$tty <$tty" | sudo tee -a "$file"; done

A little explanation of what's going on here:

Newer Ubuntu versions use upstart for system startup. With upstart, the Linux consoles are setup with config files stored within /etc/init. The command above starts by iterating over each of those config files:

for file in /etc/init/tty*.conf;

The tty's upstart config file name in $file is used to build the name of the tty device:

tty="/dev/`basename $file .conf`";

An upstart "post-start" command is built that runs "setterm" to disable screen blanking and power saving after the tty has been started:

echo "post-start exec setterm -blank 0 -powersave off >$tty <$tty"

And finally that command is appended to the upstart config file:

| sudo tee -a "$file";
  • Your answer would be a lot better if you actually described what is going on here. Just giving huge command like that with no explanation isn't very useful.
    – Zoredache
    Oct 13, 2012 at 3:01
  • @Zoredache you're right, I've added an explanation. Thanks for the feedback.
    – Chris Pick
    Jan 24, 2013 at 1:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .