Deploying RADIUS Configuring Authentication With Active Directo-Job 1075
Deploying RADIUS Configuring Authentication With Active Directo-Job 1075
html
FreeRADIUS HowTos
Getting things done quickly.
Using ntlm_auth for PAP authentication may not work on recent versions of
Samba and Active Directory. If so, just skip to the next section.
Once Samba has been installed on your system, you should edit the smb.conf
file, and configure the [global] section to point to your NT server, including
hostname and NT domain.
# workgroup = NT-Domain-Name
workgroup = MYDOMAIN
...
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = ads
# Use password server option only with security = server
password server = nt-server-hostname.company.com
...
realm = realm.company.com
For Samba 4, you also have to set the ntlm authconfiguration variable. It should
be set to either yes, or to mschapv2-and-ntlmv2-only. This configuration needs to be
set all participating Samba members, and also on (Samba4) AD-DC servers.
1 of 5 11/8/21, 11:04 PM
http://deployingradius.com/documents/configuration/active_directory.html
You may also have to edit the /etc/krb5.conf file, to add an entry that points to the
Active Directory Server. This is often not necessary, as Samba can just "figure it
out" when Active Directory is also the main DNS server.
[realms]
...
realm.company.com = {
kdc = nt-server-hostname.company.com
}
...
Start the Samba and Kerberos servers, and as root join the domain:
$ wbinfo -a user%password
You should see a number of lines of text, followed by authentication succeeded. The
next step is to try the same login with the ntlm_auth program, which is what
FreeRADIUS will be using:
If all goes well, you should see authentication succeeding (NT_STATUS_OK). You may
also see the NT_KEY output, which is needed in order for FreeRADIUS to perform
MS-CHAP authentication.
Create or edit the ntlm_auth module configuration. In version 2, this file should be
saved as raddb/modules/ntlm_auth. In version 3, it should be saved as raddb/mods-
enabled/ntlm_auth. The contents of the file are below, with the fields to edit in bold.
exec ntlm_auth {
wait = yes
2 of 5 11/8/21, 11:04 PM
http://deployingradius.com/documents/configuration/active_directory.html
This configuration tells the server to run the ntlm_auth program with the user
name and password obtained from the Access-Request. You will also have to list
ntlm_auth in the authenticate sections of each the raddb/sites-enabled/default file, and
of the raddb/sites-enabled/inner-tunnel file:
authenticate {
...
ntlm_auth
...
}
and add the following text for testing purposes only to the top of the users file.
In version 3, the "users" file has moved to raddb/mods-config/files/authorize.
This configuration says "for all users, if the authenticate method has not been
set, set it to use the ntlm_auth program".
Start the server using radiusd -X, and wait for the debugging text to stop
scrolling by. If all goes well, you should see the following text:
In another terminal window on the same machine, type the following command:
If all goes well, you should see the server returning an Access-Accept message,
and the window with radtest should print text similar to the following:
This text means that authentication succeeded. A few lines above this text, the
debug output will also show the exact command line used to run ntlm_auth.
3 of 5 11/8/21, 11:04 PM
http://deployingradius.com/documents/configuration/active_directory.html
ntlm_auth for MS-CHAP is simple. First, delete the testing entry used above
from the users file, as leaving it in will break other authentication types. Then,
find the mschap module in raddb/modules/mschap file, and look for the line containing
ntlm_auth = . It is commented out by default, and should be uncommented, and
edited to be as follows. As before, update the fields in bold to match your local
configuration.
Start the server and use radtest to send an MS-CHAP authentication request.
You will need to have version 2.1.10 or later for this to work:
If everything goes well, you should see the server returning an Access-Accept
message as above.
If it does not work, double-check the password you entered on the supplicant
against the password in Active Directory. If it still does not work, it might be a
bug in Samba. Change your version of Samba, either by installing a fixed
version, or by repeatedly down-grading it (and testing) until it works.
If it does not work, then it is possible to test authentication with just the
ntlm_auth command-line. Look at the FreeRADIUS debug output, and see the
arguments passed to ntlm_auth. Copy and paste them to a command-line, and
then use that command line for testing. This limited test is often simpler and
faster than running a complex test with a full RADIUS server. When this limited
test passes, then authentication with FreeRADIUS will work, too.
Samba Documentation
The Samba project also has a wiki page for configuring FreeRADIUS against
Active Directory.
Welcome!
RADIUS implementations can be complicated. This site contains a collection of
hints, documentation, and information for people who are using RADIUS.
Pages:
4 of 5 11/8/21, 11:04 PM
http://deployingradius.com/documents/configuration/active_directory.html
Front page
Alan DeKok's Blog
Downloads
Protocols
Configurations
Scripts
Link archive
Back to top
Site news:
How to perform an initial setup of the server.
Configuring PAP as step one to getting the server up and running with your
local policy.
Links:
FreeRADIUS
Wiki
RADIUS books
RADIUS (O'Reilly)
RADIUS (Wiley)
5 of 5 11/8/21, 11:04 PM