Where is /bin/nologin

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Oct 14 11:56:00 GMT 2011


On Oct 14 14:04, Andrey Repin wrote:
> Greetings, Corinna Vinschen!
> 
> > Or what about creating your own /sbin/nologin, something like this:
> 
> >   $ cat > /sbin/nologin <<EOF
> >   #!/bin/sh
> >   if [ -f /etc/nologin.txt ]
> >   then
> >     cat /etc/nologin.txt
> >   else
> >     echo "This account is currently not available."
> >   fi
> >   exit 0
> >   EOF
> >   $ chmod +x /sbin/nologin
> 
> I would advice against giving any clues about account status, for security
> reasons.

It's what Linux' /sbin/nologin' prints, too.  Actually it's the whole
idea of /sbin/nologin' per the man page:

  $ man nologin
  NOLOGIN(8)                BSD System Manager's Manual               NOLOGIN(8)

  NAME
       nologin — politely refuse a login
  [...]

Just `exit 0' should be replaced with `exit 1' since

  [...]
  nologin displays a message that an account is not available and exits
  non-zero.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list