Prevent non-root users from logging

May 9, 2007

Prevent non-root users from logging

Imagine that for some reason (i.e. maintenance tasks) you want to prevent non-root users from logging into the system. The next tip is a very simple way to achieve this goal.

If a file called /etc/nologin exists login will disable the begin of a session in this system. If you put some text into the file, users will be shown this text and their login attempts will be refused.

vi /etc/nologin

Server under maintenance. No access allowed at this moment.


One comment

  1. Hey there Your current site runs up incredibly
    slow in my situation, I am not sure who’s issue is that on the other hand wikipedia starts up
    extremely quick. Nevertheless, I want to thank you so much for adding beautiful blog post.
    I do believe it has been incredibly helpful individual who actually visit here.
    This one is definitely incredibly good what you actually
    have implemented and want to check out more content
    from your site. Immediately after checking out your post, I have book marked your webblog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: