FreeIPA是一個集成安全信息管理解決方案,FreeIPA服務器經過存儲管理計算機網絡安全方面所需的用戶、組、主機和其餘對象的數據,提供集中的身份驗證、受權和帳戶信息。結合了Linux、Directory Server、MIT Kerberos、NTP、DNS、Dogtag(認證系統)。它由Web界面和命令行管理工具組成。相似於windows中的AD域linux
IP | hostname | 系統 | 用途 |
192.168.48.128 | freeipa.bigdata-heboan.com | CentOS7.4 | 服務端 |
192.168.48.129 | client01.bigdata-heboan.com | CentOS7.4 | 服務端 |
systemctl stop firewalld.service systemctl disable firewalld.service setenforce 0 vi /etc/selinux/conf 設置SELINUX=disabled
①安裝ipa-serverweb
yum install ipa-server bind bind-dyndb-ldap ipa-server-dns
②配置ipa-serverwindows
[root@freeipa ~]# ipa-server-install --setup-dns
Server host name [server.test.co]: ---回車鍵(默認) Please confirm the domain name [test.co]: ---回車鍵(默認) Please provide a realm name [TEST.CO]: ---回車鍵(默認) Directory Manager password: ---設置目錄管理的密碼 最少是8位 IPA admin password: ---設置ipa 管理員admin的密碼 最少8位 必定要記住,後面要用到 Do you want to configure DNS forwarders? [yes]: no ---你想配置dns爲轉發器嗎? 選擇no Do you want to search for missing reverse zones? [yes]: yes --你想配置dns的反向域嗎?選擇yes Continue to configure the system with these values? [no]: yes --繼續配置系統其餘的值? 選擇yes
驗證ipa-server瀏覽器
[root@freeipa ~]# kinit admin Password for admin@BIGDATA-HEBOAN.COM: [root@freeipa ~]# ipa user-find --all
瀏覽器訪問https://freeipa.bigdata-heboan.com/ipa/ui緩存
①修改客戶端的DNS(網卡的配置),而後重啓網絡安全
DNS1=192.168.48.128 #指向freeipa server DNS2=114.114.114.114
②安裝ipa-client服務器
yum install -y ipa-client
②配置 client加入域網絡
[root@client01 ~]# ipa-client-install --domain=bigdata-heboan.com --no-ntp --realm=BIGDATA-HEBOAN.COM –-mkhomedir
而後根據提示輸入對應設置 Continue to configure the system with these values? [no]: yes ---繼續配置系統其餘的值? 選擇yes User authorized to enroll computers: admin ---域管理員 Password for admin@BIGDATA-HEBOAN.COM: ---密碼
在web ui上能夠看到客戶端已經加進來了dom
①添加一個用戶ssh
②策略---HBAC規則,刪除默認規則
添加一條規則
ssh能夠正常登陸了,試試sudo, 竟然提示說不容許
注意,配置sudo規則後,並不會實時生效,默認會讀取緩存,該緩存每15分鐘增量更新一次,若是想實時生效,能夠修改客戶端/etc/sssd/sssd.conf
//增長如下兩行 ladb_sudo_full_refresh_interval = 3600 ladp_sudo_smart_refresh_interval = 30
//重啓sssd服務 systemctl restart sssd
再次嘗試執行 sudo