Re: /etc/nologin file disappears

From: Chris Mattern (syscjm_at_gwu.edu)
Date: 06/26/03


Date: Thu, 26 Jun 2003 16:30:58 -0400

wayne wrote:
> 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?

You shut down. /etc/nologin is automatically removed when
you reboot.

>
> I also want to prevent root from logging in. The /etc/ssh/
> sshd_config file has the following:
>
> #PermitRootLogin yes
>
> Because it is commented out, I am assuming that the default
> is no.

No, the commented lines indicate the defaults. The comment
is meant to say "I'm not doing anything, so this is what
I'm doing."

> Do I need to explicitly set it to no?

Yes.

>
> 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.

Odd. Works for me in Solaris 8. Don't have a Red Hat
system handy to test. Nor does it take three tries;
I get the message and am kicked out. Are you sure you
remember your password correctly?

> 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.
>