FreeIPA FreeRadius FreeOTP 实现双因素认证登录

文章目录

  • 前言
  • 一、安装先决条件
  • 二、安装FreeIPA步骤
    • 1.安装前准备
    • 2.安装配置FreeIPA Server
  • 三、访问FreeIPA
    • 1.登录DNS server,添加DNS A记录
    • 2.使用浏览器访问freeipa域名
  • 四、配置FreeIPA用户
    • 1.添加用户
    • 2.关联token
    • 3.使用Free OTP 添加软令牌
    • 4.使用IPHONE扫描二维码
  • 5.使用添加用户实现双因素登录
    • 1.修改密码
    • 2.登录账号
  • 5.安装配置FreeRaiuds
  • 6.本地测试用户集成状态
    • 1.使用radiusd –X 调试
  • 七、启用FreeRadius
  • 八、集成Checkpoint,Paloalto设备认证登录
    • 1.集成Checkpoint Gaia Embedded
      • 1> 添加Radius server
      • 2> 允许用户认证登录从radius进行
      • 3> 测试登录
    • 2.集成Checkpoint Gaia
      • 1> 添加Radius server
      • 2> 添加Radius 用户权限
      • 3> 测试登录
    • 3.集成PaloAlto WEBUI
      • 1> 添加Radius server
      • 2> 添加认证授权文件
      • 3> 添加认证用户
      • 4> 测试登录
    • 4.集成Checkpoint 虚拟专用网络
      • 1> 允许虚拟专用网络用户认证登录从radius进行
      • 2> 虚拟专用网络用户登录测试
        • 未登录虚拟专用网络前
        • 登录虚拟专用网络后
  • 九、部署过程中的一些问题
    • 1.Freeradius 服务启动失败问题
    • 2.radius认证失败问题
    • 3.参考链接

前言

FreeIPA 是一款开源的身份认证系统
FreeRadius是一款开源的Radius认证系统
FreeOTP是一款软令牌客户端
本文将在CentOS 8上部署FreeIPA和FreeRadius,从而实现双因素登录设备以及双因素认证登录。


一、安装先决条件

1.CentOS8
2.dns server(WindowsServer)
3.VPN GW(Checkpoint)
4.Iphone/Android

二、安装FreeIPA步骤

1.安装前准备

命令如下:

###设置主机名###
hostnamectl set-hostname freeipa.unite-puxi.local
###修改hosts文件###
nano /etc/hosts
###添加以下行,保存并退出###
172.18.1.163 freeipa.unite-puxi.local
###默认情况下,FreeIPA软件包在CentOS标准存储库中不可用###
###启用idm:DL1存储库###
dnf module enable idm:DL1
###同步存储库###
dnf distro-sync

2.安装配置FreeIPA Server

###安装###
dnf install ipa-server ipa-server-dns -y
###配置###
ipa-server-install
#####################以下为配置过程######################
The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.
Version 4.9.6This includes:* Configure a stand-alone CA (dogtag) for certificate management* Configure the NTP client (chronyd)* Create and configure an instance of Directory Server* Create and configure a Kerberos Key Distribution Center (KDC)* Configure Apache (httpd)* Configure the KDC to enable PKINITTo accept the default shown in brackets, press the Enter key.Do you want to configure integrated DNS (BIND)? [no]: noEnter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.Server host name [freeipa.unite-puxi.local]: The domain name has been determined based on```bash```bashthe host name.Please confirm the domain name [unite-puxi.local]: The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.Please provide a realm name [UNITE-PUXI.LOCAL]:
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.Directory Manager password:
Password (confirm): The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.IPA admin password:
Password (confirm): Do you want to configure chrony with NTP server or pool address? [no]: noThe IPA Master Server will be configured with:
Hostname:       freeipa.unite-puxi.local
IP address(es): 172.18.1.163
Domain name:    unite-puxi.local
Realm name:     UNITE-PUXI.LOCALThe CA will be configured with:
Subject DN:   CN=Certificate Authority,O=UNITE-PUXI.LOCAL
Subject base: O=UNITE-PUXI.LOCAL
Chaining:     self-signedContinue to configure the system with these values? [no]: yes###############################################################

.安装成功

###开启防火墙策略###
firewall-cmd --add-service={http,https,dns,ntp,freeipa-ldap,freeipa-ldaps} --permanent
firewall-cmd --reload
###取消SELinux###
nano /etc/selinux/config
找到以下行:
SELINUX=enforcing
并且,将其替换为以下行:
SELINUX=permissive
保存并关闭文件。然后,重新启动系统以应用更改:

三、访问FreeIPA

1.登录DNS server,添加DNS A记录

2.使用浏览器访问freeipa域名

https://freeipa.unite-puxi.local
用户名:admin
密码:ipa-server-install 设置的admin 密码

四、配置FreeIPA用户

1.添加用户

2.关联token


3.使用Free OTP 添加软令牌

4.使用IPHONE扫描二维码


5.使用添加用户实现双因素登录

1.修改密码

输入密码以及IPHONE上的OTP数字,用以修改密码

2.登录账号

输入修改后的密码以及IPHONE上OTP令牌数字


5.安装配置FreeRaiuds

####安装freeradius及相关组件####
yum install freeradius freeradius-utils freeradius-ldap freeradius-krb5####配置Radius认证的客户端网段####
vim /etc/raddb/clients.conf
client localnet { ipaddr = 172.18.1.0/24 proto = * secret = somesecret nas_type = nonelimit { max_connections = 30 life = 0 idle_timeout = 30 }
}
####修改/etc/raddb/sites-enabled/default 中ldap配置,确保认证用户从ldap数据库中获取密码
vim /etc/raddb/sites-enabled/default#  The ldap module reads passwords from the LDAP database.ldapif ((ok || updated) && User-Password) {update {control:Auth-Type := ldap}}####取消以下注释####
#       Auth-Type LDAP {
#               ldap
#       }
####修改/etc/raddb/sites-enabled/inner-tunnel 中ldap配置,确保认证用户从ldap数据库中获取密码
vim /etc/raddb/sites-enabled/inner-tunnel#  The ldap module reads passwords from the LDAP database.ldapif ((ok || updated) && User-Password) {update {control:Auth-Type := ldap}}####取消以下注释####
#       Auth-Type LDAP {
#               ldap
#       }####添加LDAP到mods-enabled中####
ln -s /etc/raddb/mods-available/ldap /etc/raddb/mods-enabled/####修改mods-enable中LDAP属性####
vim /etc/raddb/mods-enabled/ldap
server = 'freeipa.unite-puxi.local'
base_dn = 'cn=users,cn=compat,dc=unite-puxi,dc=local'####开放防火墙策略####
firewall-cmd --permanent --zone=public --add-port=1812/udp --add-port=1813/udp####重启防火墙服务####
systemctl restart firewalld.service

6.本地测试用户集成状态

1.使用radiusd –X 调试

###打开调试页面###
radiusd –X
......
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default
Listening on auth address :: port 1812 bound to server default
Listening on acct address :: port 1813 bound to server default
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on proxy address * port 44742
Listening on proxy address :: port 51189
Ready to process requests####打开测试页面,用户为FreeIPA创建的用户”chenjingwen“####
####密码为“Admin123”,Token为“820521”####
####认证域名”freeipa.unite-puxi.local “,secret为”somesecret“####
radtest chenjingwen Admin123820521 freeipa.unite-puxi.local 1812 somesecret
#####测试结果如下####
Sent Access-Request Id 153 from 0.0.0.0:32890 to 172.18.1.163:1812 length 81User-Name = "chenjingwen"User-Password = "Admin123820521"NAS-IP-Address = 172.18.1.163NAS-Port = 1812Message-Authenticator = 0x00Cleartext-Password = "Admin123820521"
Received Access-Accept Id 153 from 172.18.1.163:1812 to 172.18.1.163:32890 length 20

七、启用FreeRadius

####添加开机启动并开启服务####
systemctl enable radiusd
systemctl start radiusd.service

八、集成Checkpoint,Paloalto设备认证登录

1.集成Checkpoint Gaia Embedded

1> 添加Radius server

2> 允许用户认证登录从radius进行

3> 测试登录


2.集成Checkpoint Gaia

1> 添加Radius server

2> 添加Radius 用户权限

目前没有进行radius侧授权的测试,后续展开

3> 测试登录


3.集成PaloAlto WEBUI

1> 添加Radius server

2> 添加认证授权文件

3> 添加认证用户

4> 测试登录


4.集成Checkpoint 虚拟专用网络

1> 允许虚拟专用网络用户认证登录从radius进行

2> 虚拟专用网络用户登录测试

未登录虚拟专用网络前

登录虚拟专用网络后

九、部署过程中的一些问题

1.Freeradius 服务启动失败问题

优于证书未生成导致,可执行./bootstrap解决

cd  /etc/raddb/certs
./bootstrap

2.radius认证失败问题

请确认/etc/raddb/mods-available/ldap 中的base dn是否正确

/etc/raddb/mods-available/ldapserver = 'freeipa.unite-puxi.local'base_dn = 'cn=users,cn=compat,dc=unite-puxi,dc=local'

3.参考链接

在Centos7上使用 FreeIPA 和 FreeRadius 实现基于 RADIUS 的软件令牌 OTP 的认证

FreeIPA FreeRadius FreeOTP 实现双因素认证登录相关推荐

  1. 登录的双因素认证-Golang实现

    需求 实现登录双因素认证 开源库使用 框架:github.com/gin-gonic/gin 验证码:github.com/dchest/captcha session管理:github.com/go ...

  2. 提升云桌面登录账号安全,宁盾双因素认证“护航”齐鲁制药移动办公

    客户介绍: 齐鲁制药,是中国大型综合性现代制药企业,中国医药工业百强企业,专业从事治疗肿瘤.心脑血管.抗感染.精神系统.神经系统.眼科疾病的制剂及其原料药的研制.生产与销售.齐鲁制药销售总公司是齐鲁制 ...

  3. 如何为***选择合适的动态密码双因素认证方案

    CKEY动态密码认证是双因子认证的一种方式,×××用户增加动态密码认证,借助此方案可以提升×××远程拨入安全,加强登陆用户审计. CKEY为×××提供短信密码.硬件令牌.软件令牌.短信密码+硬件令牌混 ...

  4. 业余草双因素认证(2FA)教程

    所谓认证(authentication)就是确认用户的身份,是网站登录必不可少的步骤. 密码是最常见的认证方法,但是不安全,容易泄露和冒充. 越来越多的地方,要求启用双因素认证(Two-factor ...

  5. 知名密码管理应用LastPass启用双因素认证

    如果你真的关心在线账号的安全,那么你可能已经了解并使用多因素认证.今天知名密码管理软件LastPass宣布了名为"LastPass Authenticator"的应用程序,这家已经 ...

  6. 双因素认证(2FA)

    转自:  http://www.ruanyifeng.com/blog/2017/11/2fa-tutorial.html 所谓认证(authentication)就是确认用户的身份,是网站登录必不可 ...

  7. 关于双因素认证(2FA),这些基础知识你一定要知道

    如今,在线时间占据了生活的一大部分.远程工作.社交媒体人气的激增以及元宇宙的出现意味着如今的数字身份与现实身份一样重要,而维护数字身份安全也变得更加重要. 双因素认证(2FA)作为额外安全层为账号登录 ...

  8. 双因素认证令牌_(完整版)双因素认证解决方案

    双因素认证方案 一. 网络安全认证的需求背景 网络钓鱼.欺诈等网络犯罪现象已经达到非常严峻的情况,用户如果只依赖个人密码进行 帐户登录或网上交易, 是非常危险和不可靠的认证方法. 针对这些问题, 北京 ...

  9. 服务器双因素认证微软Ad,12-双因素认证(MIX)配置举例

    双因素认证(MIX)是指,将运维审计系统已有的认证方式(本地认证.ldap认证.radius认证.TOTPMobile认证)两两组合的一种更高强度的认证方式.被组合的两种认证方式可以是逻辑关系上的&q ...

  10. 双因素认证,让用户的帐号安全无忧

    在数字化信息化的今天,"帐号"成为每个人必不可少的网络通行凭证,它关联着个人的数字资产与隐私,甚至影响着现实资产的安全性. 如何确保用户帐号安全,是所有开发者都极为重视的问题,而& ...

最新文章

  1. C#创建和调用DLL
  2. lucene搜索之facet查询原理和facet查询实例——TODO
  3. 汤家凤高等数学基础手写笔记-极限与连续
  4. java 配置hdfs集群_Hadoop集群搭建-04安装配置HDFS
  5. 国产“电动牦牛”亮相,负重 160 公斤健步如飞!
  6. 专利案件管理软件 唯德系统
  7. tsm如何备份oracle原理,技巧 | 使用TSM备份Oracle,怎么设置通道更好?
  8. 如何避免 obj1 + obj2 = obj3 错误?
  9. 史上最详细的vsftpd配置文件讲解
  10. 手机怎么打开psd文件(实用方法)
  11. ROSE HA高可用性软件介绍(转载)
  12. SSM框架学习——Maven进阶学习
  13. 关于windows桌面网络图标显示未连接却可以上网的情况
  14. Oracle日期函数months_between的用法
  15. os.listdir()详解
  16. 计算机作业我家乡的变化英语作文,我家乡的变化英语作文(精选12篇)
  17. 《无线与移动网技术》笔记(二)无线网络物理层技术(非全)
  18. MATLAB调用USB摄像头的过程记录
  19. Windows: HBuilderX Git使用教程
  20. Flutter 公司组织结构实体类递归构造 递归查询

热门文章

  1. 机器学习 Python scikit-learn 中文文档(10)Scikit-Learn 处理文本数据
  2. hardfault常见原因_keil遇到hardfault时原因的查找
  3. linux inet_aton使用实例,C语言中实现inet_aton和inet_ntoa函数功能
  4. Python Flask学习_使用flask-login实现认证蓝本(一)
  5. jQuery ajax 文件下载
  6. 【2020新书推荐】程序员值得一读的机器学习新书
  7. getrusage-进程资源统计函数
  8. Python第四天——requests实战
  9. 长江学者石照耀剖析精密减速机国产化之路—山坳上的机器人精密减速器
  10. graphpad prism横坐标怎么设置不显示数值_graphpad,prism,符号显示有问题