Re: /etc/nologin file disappears

From: Bill Unruh (unruh_at_string.physics.ubc.ca)
Date: 06/25/03


Date: 24 Jun 2003 22:51:42 GMT

wayne <wayne@localhost.localdomain> writes:

]I am trying to make my system at home as secure as possible.
]One thing I tried was to create a /etc/nologin file. It
]worked in that I couldn't log in to ssh as me, but I could
]as root. After shutting down for the night, the next day the
]file was gone! File privileges were set to 444. What's going
]on?

The nologin file is there to prevent people from logging on while the
system is getting ready to shut down. That is its purpose. When it comes
up again, the file is removed since it is no longer getting ready to
shut down.

]I also want to prevent root from logging in. The /etc/ssh/
]sshd_config file has the following:

So why not just switch off the system. Then noone can log in.

Why would you want to prevent everyone from logging in. Sounds like a
pretty useless system to me.

] #PermitRootLogin yes

]Because it is commented out, I am assuming that the default
]is no. Do I need to explicitly set it to no?

No, that file lists the options together with their default values.

]One other issue, the contents of /etc/nologin is not echoed
]when I attempt to log in as me. It simply fails after three
]tries and hangs up. When I ssh in as root, the contents of
]/etc/nologin are echoed. This is not working as advertised.

]I am running Redhat 9.1 with openssh-3.5p1-6.

]Thanks,

]-- Wayne.



Relevant Pages