/sbin/nologin と /bin/false

その違いを知らないことに、いまさら気付きました。

man nologin


NOLOGIN(8) System Manager's Manual NOLOGIN(8)

NAME
nologin - politely refuse a login

SYNOPSIS
nologin

DESCRIPTION
nologin displays a message that an account is not available and exits
non-zero. It is intended as a replacement shell field for accounts that
have been disabled.

If the file /etc/nologin.txt exists, nologin displays its contents to the
user instead of the default message.

SEE ALSO
login(1)

HISTORY
The nologin command appeared in 4.4BSD.

BSD February 15, 1997 BSD

man false


FALSE(1) FSF FALSE(1)

NAME
false - do nothing, unsuccessfully

SYNOPSIS
false [ignored command line arguments]
false OPTION

DESCRIPTION
Exit with a status code indicating failure.

These option names may not be abbreviated.

--help display this help and exit

--version
output version information and exit

AUTHOR
Written by no one.

REPORTING BUGS
Report bugs to .

COPYRIGHT
Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty;
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO
The full documentation for false is maintained as a Texinfo manual. If the info and
false programs are properly installed at your site, the command

info false

should give you access to the complete manual.

GNU sh-utils 2.0.11 April 2002 FALSE(1)

で、実際なにが違うのさ。

ググると、「 nologin はシェルログインできないけど、FTP ログインできるよ。 false は FTP すら無理」だとか、「シェルログインできるユーザから、su できるかどうかも違うよ」みたいな情報を拾ったが、実際には確認していない。その違いについてきっちり書いたドキュメントはどこかにないものだろうか。
/etc/shells を見てみると、OS によって nologin があったり false があったり。



ttp://blog.so-net.ne.jp/nekohat/2006-04-04
あぁ、こういうことか。/etc/shells ファイルにまでアタリをつけながらも、この結論を導き出せなかった自分が歯痒い。そういえば、ProFTPD は /etc/shells ファイルを参照してるなぁって、随分昔に何か調べてるときに見かけてたのに。

20150515追記
ひっさしぶりにこの話を思い出して読み返していたが、上記ブログが無くなっていたので、web archive を読み返してみた。
要約すると、シェルログインさせたくないケースには FTP ログインはさせてもいい場合とそうでない場合とに大別されると考えられ、FTPサーバの多くは /etc/shells を参照する。それをふまえて、FTP ログインの要否,/etc/shells の記載,FTP サーバの実装から判断すればよいのではないか、というようなことだと理解した。