我使用最簡單的方式將使用者帳號密碼設定於 users 檔中,新增了一個使用者帳號為密碼為 user / pass:
- 設定 radiusd.conf:因為使用者帳號存在檔案中,因此要確認 authorize 檔中的 file 這個屬性不能被 mark 起來(將#符號取消)
- 由於是在本機端認證,因此不需要修改 proxy.conf
- 在users中加入下列幾行:
user User-Password == "pass"
Reply-Message = "Hello World!"
設定完成之後,要如何確定設定是否正確呢?可以利用 radtest 這個指令,其格式為 radtest [帳號] [密碼] [認證位址:認證埠] [NAS port] [secret key]:
[root@localhost ~]# radtest user pass localhost 0 testing123Sending Access-Request of id 75 to 127.0.0.1 port 1812 User-Name = "user" User-Password = "pass" NAS-IP-Address = 255.255.255.255 NAS-Port = 0rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=75, length=57 Reply-Message = "Hello World!"
本篇轉錄自經濟部工業局