Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to display a customized message for "/usr/sbin/nologin". As far as I remember this can be accomplished by creating the file "/etc/nologin.txt" with the desired text in it.

But it doesn't work in Ubuntu 12.04 (LTS (GNU/Linux 3.2.0-38-generic x86_64)) - it displays only the "standard" message:

$ cat /etc/nologin.txt
Sorry, there is no login shell
$ nologin
This account is currently not available.

Am I missing something?

share|improve this question
up vote 1 down vote accepted

You can check the output of

 strace /usr/sbin/nologin 2>&1 | grep open

These files are accessed by nologin. I don't have Ubuntu, but in Debain there's the following output:

 open("/etc/", O_RDONLY)      = 3
 open("/lib/", O_RDONLY)        = 3
 open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 3
 open("/etc/localtime", O_RDONLY)        = 3

Compared with a system, where /etc/nologin.txt is displayed (openSuSE 11), the important line is missing

 open("/etc/nologin.txt", O_RDONLY)      = -1 ENOENT (No such file or directory)

Hence, it looks like the changing of the default message is not provided.

man 5 nologin states

If the file /etc/nologin exists, login(1) will allow access only to root. Other users will be shown the contents of this file and their logins will be refused.

But that's probably not, what you want either...

share|improve this answer
Thank you very much for clearing things up. Seems that Debian / Ubuntu are not accessing the nologin.txt whereas Feodora, Suse does. – jaltek Mar 12 '13 at 16:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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