Installation von Freeradius unter Debian
Radius-Server mit PAM
Installation von Freeradius unter Debian
Debian Paket freeradius apt-get install freeradius
Die Standardeinstellung für die Authentifizierung ist auf /etc/shadow gesetzt
Konfiguration:
/etc/freeradius/clients
domain.tld testkey
/etc/freeradius/realms
/etc/freeradius/clients.conf
client domain.tld {
secret = local
shortname = server
}
/etc/freeradius/radiusd.conf (Server Konfigurationsdatei)
user = freerad
group = freerad
# CLIENTS CONFIGURATION
# Client configuration is defined in "clients.conf".
$INCLUDE ${confdir}/clients.conf
# MODULE CONFIGURATION
modules {
# ...
unix {
cache = no
cache_reload = 600
shadow = /etc/shadow
radwtmp = ${logdir}/radwtmp
}
# ...
}
authorize {
# ...
files
# ...
}
authenticate {
# ...
Auth-Type PAP {
pap
}
# ...
unix
# ...
}
/etc/freeradius/users
DEFAULT Auth-Type = System
Fall-Through = 1
/var/log/freeradius/radius.log ist die Logdatei des Servers.
| Programme | |
|---|---|
| /usr/bin/radwho | zeigt angemeldete User |
| /usr/bin/radzap | entfernt Einträge aus Session Datenbank |
| /usr/bin/radlast | zeigt letzte Information der radwtmp |
| /usr/bin/radclient | sendet Pakete zum Radiusserver |
Syntax: radclient [options] server[:port] <command> [<secret>] <command> kann dabei auth oder acct sein.
z.B.
echo "User-Name = user,User-Password = pass" | radclient domain.tld auth local
echo "User-Name = user,User-Password = pass,Acct-Status-Type = Start" | radclient domain.tld acct local
VALUE Acct-Status-Type Start 1 VALUE Acct-Status-Type Stop 2 VALUE Acct-Status-Type Alive 3 VALUE Acct-Status-Type Accounting-On 7 VALUE Acct-Status-Type Accounting-Off 8
| Programme | |
|---|---|
| /usr/bin/radrelay | wiederholt Accountdaten zu einen anderen Radiusserver |
| /usr/sbin/checkrad | |
| /usr/sbin/radwatch | |
| /usr/sbin/check-radiusd-config | Server Konfiguration testen |
| /usr/sbin/freeradius | Radiusserver |
| /usr/bin/radtest | Testen des Radius-Servers |
Syntax:
radtest username password servername port secret
z.B.
#radtest user pass domain.tld 0 local
Sending Access-Request of id 54 to 192.168.2.100:1812
User-Name = "user"
User-Password = "pass"
NAS-IP-Address = domain.tld
NAS-Port = 0
Re-sending Access-Request of id 54 to 192.168.2.100:1812
User-Name = "user"
User-Password = "\202\251qI\257\342\215\275x\316\344|?:|\211"
NAS-IP-Address = domain.tld
NAS-Port = 0
rad_recv: Access-Reject packet from host 192.168.2.100:1812, id=54, length=20
Radius-Server mit PAM
1. Modul pam_radius-x.x.xx.tar von ftp://ftp.freeradius.org/pub/radius/ laden
2. entpacken
tar xvf pam_radius-x.x.xx.tar
3. mit make übersetzen
4. pam_radius_auth.o nach /lib/security kopieren
cp pam_radius_auth.so /lib/security/
Einrichtung der PAM Authentifizierung in /etc/pam.d/login
login auth required /lib/security/pam_securetty.so login auth sufficient /lib/security/pam_radius_auth.so login auth required /lib/security/pam_unix_auth.so auth required /lib/security/pam_securetty.so auth sufficient /lib/security/pam_radius_auth.so auth required /lib/security/pam_unix_auth.so