在上篇文章中使用了ISE作为AAA server,ISE功能上虽然较多,但是对于新手操作起来还是有些繁琐。所以我在想是否能找到AAA server替代品,只需要简单的配置就可以满足我认证测试的需求,然后我就找到freeradius。所以本文就介绍下我在测试freeradius时遇到的一些坑以及排错。
Starting the server
docker run --rm --name my-radius -d freeradius/freeradius-server
使用上述命令就可以快速创建一个radius server,添加“–rm”使容器停止后自动删除.
由于这个容器中没vi/nano command,我无法去编辑配置文件,所以在将docker run起来后进去将配置文件copy 出来一份,在本地进行修改。
[root@server1 ~]# docker exec -it my-radius /bin/bash
root@3c05e2ec2770:/# cd /etc/raddb
root@3c05e2ec2770:/etc/raddb# ls -al
total 148
drwxr-s--x. 9 freerad freerad 4096 Oct 7 19:58 .
drwxr-xr-x. 1 root root 66 Feb 22 02:21 ..
-rw-r--r--. 1 root root 20819 Oct 7 17:00 README.rst
drwxr-s--x. 2 freerad freerad 4096 Oct 7 20:00 certs
-rw-r-----. 1 root freerad 8323 Oct 7 17:00 clients.conf
-rw-r--r--. 1 root freerad 1440 Oct 7 17:00 dictionary
-rw-r-----. 1 root freerad 2661 Oct 7 17:00 experimental.conf
lrwxrwxrwx. 1 root root 28 Oct 7 17:00 hints -> mods-config/preprocess/hints
lrwxrwxrwx. 1 root root 33 Oct 7 17:00 huntgroups -> mods-config/preprocess/huntgroups
drwxr-xr-x. 2 root root 4096 Oct 7 19:58 mods-available
drwxr-xr-x. 9 root root 126 Oct 7 19:58 mods-config
drwxr-xr-x. 2 root root 4096 Oct 7 19:58 mods-enabled
-rw-r--r--. 1 root root 52 Oct 7 17:00 panic.gdb
drwxr-s--x. 2 freerad freerad 205 Oct 7 19:58 policy.d
-rw-r-----. 1 root freerad 28825 Oct 7 17:00 proxy.conf
-rw-r-----. 1 root freerad 31521 Oct 7 17:00 radiusd.conf
drwxr-s--x. 2 freerad freerad 4096 Oct 7 19:58 sites-available
drwxr-s--x. 2 freerad freerad 41 Oct 7 19:58 sites-enabled
-rw-r--r--. 1 root root 3470 Oct 7 17:00 templates.conf
-rw-r--r--. 1 root root 8536 Oct 7 17:00 trigger.conf
lrwxrwxrwx. 1 root root 27 Oct 7 17:00 users -> mods-config/files/authorize
root@3c05e2ec2770:/etc/raddb#
root@3c05e2ec2770:/etc/raddb#
root@3c05e2ec2770:/etc/raddb# cat clients.conf
root@3c05e2ec2770:/etc/raddb# cat mods-config/files/authorize
root@3c05e2ec2770:/etc/raddb# cat /etc/freeradius/sites-enabled/default
root@3c05e2ec2770:/etc/raddb# exit
exit
[root@server1 ~]# docker stop my-radius <<< 停止容器,因为后面我们要使用自己定义的配置文件启动
my-radius
[root@server1 ~]#