📄 auth.texi
字号:
@c This is part of the Radius manual.@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.@c Written by Sergey Poznyakoff@c See file radius.texi for copying conditions.@comment *******************************************************************@node Authentication, Accounting, Request Comparison, Top@chapter AuthenticationAn @dfn{Authentication Type} specifies which credentials the useris required to supply in order to be authenticated and where theuser's authentication data are stored. It is defined by the valueof @attr{Auth-Type} attribute in @LHS{} of a @file{users} entry.@menu* Accept Auth:: Accept unconditionally.* Reject Auth:: Reject unconditionally.* Local Password Auth:: Authenticate using plaintext password.* Encrypted Password Auth:: Authenticate using MD5 encrypted password.* System Auth:: Authenticate using system account.* SQL Auth:: Authenticate using SQL.* PAM Auth:: Authenticate using PAM.* Custom Auth:: Defining Custom Authentication Types.* Multiple Login Checking:: Checking for Simultaneous Logins.* Auth Probing:: Controlling Authentication Probes @end menu@comment *L2****************************************************************@node Accept Auth@section Accept Authentication Type@cindex Accept Authentication Type@cindex Guest accounts, setting up@exindex Guest accounts, setting up@dfn{Accept} is the simplest authentication type. Users with thisauthentication type will be authenticated successfully without checkingany credentials. Actually this means that only usernameis required for authentication.This authentication type is used for each @file{users} entry, whose@LHS{} contains@smallexampleAuth-Type = Accept@end smallexample@noindentThis authentication type can be used for guest accounts, e.g. thefollowing profile in @file{users}:@smallexample@groupguest Auth-Type = Accept, Simultaneous-Use = 10 Service-Type = Framed-User, Framed-Protocol = PPP@end group@end smallexample@noindentallows up to 10 simultaneous guest PPP accounts. To log in using suchguest account it is sufficient to use username @samp{guest} and anypassword.@comment *L2****************************************************************@node Reject Auth@section Reject Authentication Type@cindex Reject Authentication Type@cindex Disabling user accountsThe @dfn{Reject} authentication type causes the request to be rejectedunconditionally. It can be used to disable a user account (For anothermethod of disabling user accounts, @pxref{access.deny file}).This authentication type is used for each @file{users} entry, whose@LHS{} contains@smallexampleAuth-Type = Reject@end smallexample@comment *L2****************************************************************@node Local Password Auth@section Local Password Authentication Type@cindex Local Password Auth@cindex CHAPThe @dfn{Local Password} authentication type allows to keep plaintextuser passwords. Although the use of this authentication type is stronglydiscouraged for security reasons, this is the onlyauthentication type that can be used with @acronym{CHAP} authentication.There are two ways of using this authentication type@subheading Specifying Passwords in users File.To keep the plaintext passwords in @file{users} file, the profileentry must follow this pattern:@smallexample@group@var{user-name} Auth-Type = Local, User-Password = @var{plaintext}@end group@end smallexampleThe @var{plaintext} is the user's plaintext password. Obviously,@var{user-name} may not be @code{DEFAULT} nor @code{BEGIN}.@subheading Specifying Passwords in SQL Database.@smallexample@group@var{user-name} Auth-Type = Local, Password-Location = SQL@end group@end smallexampleWhen the user is authenticated using such profile, its passwordis retrieved from the authentication database using @code{auth_query}.The configuration of @acronym{SQL} authentication is described indetail in @ref{Authentication Server Parameters}.@comment *L2****************************************************************@node Encrypted Password Auth@section Encrypted Password Authentication Type@cindex Encrypted Password Authentication TypeThe @dfn{Encrypted Password} type allows to keep user's passwordsencrypted via @acronym{DES} or @acronym{MD5} algorithm. There aretwo ways of using this authentication type.@subheading Specifying Passwords in users File.@smallexample@var{user-name} Auth-Type = Crypt-Local, User-Password = @var{crypt-pass}@end smallexample@noindentThe @attr{Crypt-Password} is a shortcut for the above notation:@smallexample@var{user-name} Crypt-Password = @var{crypt-pass}@end smallexample@subheading Specifying Passwords in SQL Database.@smallexample@group@var{user-name} Auth-Type = Crypt-Local, Password-Location = SQL@end group@end smallexampleUsing this profile, the user's password is retrieved from theauthentication database using @code{auth_query}.The configuration of @acronym{SQL} authentication is described indetail on @ref{Authentication Server Parameters}.The shortcut for this notation is @code{Auth-Type = SQL}.In any case, the passwords used with this authentication typemust be either @acronym{DES} or @acronym{MD5} hashed.@comment *L2****************************************************************@node System Auth@section System Authentication Type@cindex System Authentication TypeThe @dfn{System} authentication type requires that the userhave a valid system account on the machine where the radiusserver is running. The use of this type is triggered by setting@smallexampleAuth-Type = System@end smallexample@noindentin the @LHS{} of a @file{users} entry.@comment *L2****************************************************************@node SQL Auth@section SQL Authentication Type@cindex SQL Authentication TypeSetting @code{Auth-Type = SQL} or @code{Auth-Type = Mysql}in the @LHS{} of a @file{users} entry is a synonym for@smallexampleAuth-Type = Crypt-Local, Password-Location = SQL@end smallexample@noindentand is provided as a shortcut and for backward compatibility withprevious versions of GNU Radius.For description of @acronym{SQL} authentication, see @ref{EncryptedPassword Auth}. The configuration of @acronym{SQL} subsystemis described in @ref{sqlserver file}.@comment *L2****************************************************************@node PAM Auth@section PAM Authentication Type@cindex PAM Authentication Type@dfn{PAM} authentication type indicates that a user should be authenticatedusing @acronym{PAM} (Pluggable Authentication Module) framework. Thesimplest way of usage is:@smallexampleAuth-Type = PAM@end smallexample@noindentAny user whose @file{users} profile contains the above, will beauthenticated via @acronym{PAM}, using service name @samp{radius}.If you wish to use another service name, set it using @attr{Auth-Data}attribute, e.g.:@smallexampleAuth-Type = PAM, Auth-Data = @var{pam-service}@end smallexample@comment *L2****************************************************************@node Custom Auth@section Defining Custom Authentication Types@cindex Custom Authentication TypesThe are three ways to define custom authentication types:@enumerate 1@item Write a @acronym{PAM} module.@item Use a Guile procedure.@item Use an external program@end enumerateYou can write a @acronym{PAM} module implementing the new authenticationtype. Then, specifying @code{Auth-Type = PAM} allows to applyit (@pxref{PAM Auth}).Alternatively, you may write a Scheme procedure implementing the newauthentication type. To apply it, use @attr{Scheme-Procedure} attributein @RHS{}. The @code{Auth-Type = Accept} can be used in @LHS{} ifthe whole authentication burden is to be passed to the Scheme procedure.For example, if one wrote a procedure @code{my-auth}, to apply it toall users, one will place the following profile in his @file{users}file:@smallexample@groupDEFAULT Auth-Type = Accept Scheme-Procedure = "my-auth"@end group@end smallexampleFor a discussion of how to write Scheme authentication procedures,@xref{Authentication with Scheme}.The third way to implement your own authentication method is usingan external program. This is less effective than the methods describedabove, but may be necessary sometimes. To invoke the program, usethe following statement in the @RHS{} of @file{users} entry:@smallexampleExec-Program-Wait = "@var{progname} @var{args}"@end smallexample@noindentThe @var{progname} must be the full path to the program, @var{args} ---any arguments it needs. The usual substitutions may be used in@var{args} to pass any request attributes to the program(@pxref{Macro Substitution}).For a detailed description of @attr{Exec-Program-Wait} attribute andan example of its use, see @ref{Exec-Program-Wait}.@comment *L2****************************************************************@node Multiple Login Checking@section Multiple Login Checking@cindex Multiple Login Checking@cindex Simultaneous logins, checking forThe number of sessions a user can have open simultaneously can berestricted by setting @attr{Simultaneous-Use} attribute in the user'sprofile @LHS{} (@pxref{Simultaneous-Use}). By default the numberof simultaneous sessions is unlimited.When a user with limited number of simultaneous logins authenticateshimself, Radius counts the number of the sessions that are alreadyopened by this user. If this number is equal to the value of@attr{Simultaneous-Use} attribute the authentication request isrejected.This process is run in several stages. First, Radius retrieves theinformation about currently opened sessions from one of its accountingdatabases. Then, it verifies whether all these sessions are stillactive. This pass is necessary since an open entry might be a resultof missing @code{Stop} request. Finally, the server counts thesessions and compares their count with the value of@attr{Simultaneous-Use} attribute.The following subsections address each stage in detail.@menu* Retrieving Session Data::* Verifying Active Sessions::@end menu@node Retrieving Session Data@subsection Retrieving Session DataRadius retrieves the list of sessions currently opened by the usereither from the system database (@pxref{System Accounting}), or fromthe @acronym{SQL} database (@pxref{SQL Accounting}). The system administratordetermines which method to use.By default, system accounting database is used. Its advantages aresimplicity and ease of handling. It has, however, a seriousdeficiency: the information is kept in the local files. If you runseveral radius servers, each of them has no easy way of knowing aboutthe sessions initiated by other servers.This problem is easy to solve if you run @dfn{SQL accounting}(@pxref{SQL Accounting}). In this case, each radius server stores the data inyour @acronym{SQL} database and can easily retrieve them from there.To enable use of @acronym{SQL} database for multiple login checking, do thefollowing:In your @file{raddb/config} file set:@smallexamplemlc @{ method sql;@};@end smallexampleIn your @file{raddb/sqlserver} file, specify the queries for
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -