RADIUS for pppd on Linux
[ Nob's Home |
Linux/i386 ]
pptpdサーバーへの接続のときRADIUS serverで認証させます。
RADIUS server
RADIUS serverとしてfreeradiusを使用します。
pppd が動いているホストとは別のホストで radiusd は起動しています。
pppdをcvsの最新のものにすると /usr/lib/pppd/2.4.***/radius.so がインストールされています。
# vi /etc/ppp/pptpd-options
debug
name makioka2
domain y-min.or.jp
auth
#
plugin radius.so ← 有効にします
#
require-mschap
require-mschap-v2
require-mppe
require-mppe-40
require-mppe-128
mppe-stateful
netmask 255.255.255.0
nodefaultroute
proxyarp
lock
|
# vi /etc/radiusclient/radiusclient.conf
authserverとacctserver以外は全てdefaultのまま。
auth_order radius
login_tries 4
login_timeout 60
nologin /etc/nologin
issue /etc/radiusclient/issue
#
# 次の2行で radius server を設定する
authserver radius.y-min.or.jp:1812
acctserver radius.y-min.or.jp:1813
#
servers /etc/radiusclient/servers
dictionary /etc/radiusclient/dictionary
login_radius /usr/sbin/login.radius
seqfile /var/run/radius.seq
mapfile /etc/radiusclient/port-id-map
default_realm
radius_timeout 10
radius_retries 3
login_local /bin/login
#
|
# vi /etc/radiusclient/servers
使用する radius serverと接続のためのpasswordを記載しておく。
#Server Name or Client/Server pair Key
#---------------- ---------------
radius.y-min.or.jp hogehoge
|
このpasswordは radius serverの設定した
/usr/local/etc/raddb/clientsのものと一致している必要があります。
接続
Windows2000でpptp接続してみます。
pptpd サーバーで
# tail -f /var/log/debug
radius サーバーで
# radiusd -X
としてdebugします。
freeradiusの設定で登録したbobでpptp接続しようとすると、
rad_check_password: Found Auth-Type Local
auth: type Local
auth: No User-Password or CHAP-Password attribute in the request
auth: Failed to validate the user.
とエラーになり認証されません。
radius serverでauthorizeとauthenticateにmschapを加えると認証されます。
# vi /usr/local/etc/raddb/radiusd.conf
authorize {
files
mschap
}
authenticate {
mschap
}
|
/etc/passwdのユーザーは
modcall: entering group authorize
users: Matched DEFAULT at 156
users: Matched DEFAULT at 175
users: Matched DEFAULT at 187
modcall[authorize]: module "files" returns ok
modcall[authorize]: module "mschap" returns notfound
modcall: group authorize returns ok
rad_check_password: Found Auth-Type System
auth: type "System"
modcall: entering group authenticate
rlm_unix: Attribute "User-Password" is required for authentication.
modcall[authenticate]: module "unix" returns invalid
となって認証できませんでした。
[ Nob's Home |
Linux/i386 ]
nob@makioka.y-min.or.jp