This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Where is /bin/nologin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]