一起學習如何配置AAA認證(AAA認證配置)
華為
配置管理員使用Radius+Local方式認證并授權用戶級別。
1.配置Stelnet登錄。
#在服務器端生成本地密鑰對。
system-view
sysname switch
dsa local-key-pair create
#配置VTY用戶界面0~14的認證方式為AAA認證,支持的協議為SSH。
user-interface vty 0 14
authentication-mode aaa
protocol inbound ssh
quit
#開啟設備的SSH服務器功能。
ssh server-source -I vlanif 10 #假設VLANIF 10為管理網口。有管理網口的設備需要執行此步驟,從而將管理網口配置為SSH服務器端的源接口,提高系統安全性。
stelnet server enable
#配置所有SSH用戶的認證方式為Password認證、服務方式為Stelnet。
ssh authentication-type default password
2.配置RADIUS認證。
#配置RADIUS服務器模板,實現與RADIUS服務器的通信。
radius-server template 1
radius-server authentication 10.1.6.6 1812
radius-server accounting 10.1.6.6 1813
radius-server shared-key cipher Example@123
quit
#配置AAA認證方案,指定認證方式為RADIUS+local。
aaa
authentication-scheme sch1
authentication-mode radius local
quit
#配置計費方案acc1,指定計費方式為RADIUS計費。
accounting-scheme acc1
accounting-mode radius
accounting start-fail online
quit
#在域下引用AAA認證方案,RADIUS服務器模板。
domain example.com
authentication-scheme sch1
accounting-schme acc1
radius-server 1
quit
#配置example.com為全局默認管理域。
domain example.com admin
3.配置本地認證。
#配置本地賬號“user1”,密碼“Example@123”,級別為15級。
aaa
local-user user1 password irreversible-cipher Example@123
local-user user1 service-type ssh
local-user user1 privilege level 15
return
4.配置RADIUS服務器。
添加設備、添加用戶、配置用戶級別為15級。
5.驗證配置結果。
管理員通過STelnet客戶端軟件登錄交換機。
display access-user username user1 detail #查看用戶user1的信息。
H3C
SSH用戶的RADIUS認證和授權配置。
1.配置RADIUS服務器
增加接入設備、增加設備管理用戶。
2.配置交換機。
#生成RAS及DSA密鑰對。
system-view
public-key local create rsa
public-key local create dsa
#使能SSH服務器功能。
ssh server enable
#設置SSH用戶登錄用戶線的認證方式為AAA認證。
line vty 0 63
authentication-mode scheme
quit
#使能缺省用戶角色授權功能,使得認證通過后的SSH用戶具有缺省的用戶角色network-operator。
role default-role enable
#創建RADIUS方案rad。
radius scheme rad
#配置主認證服務器的IP地址為10.1.1.1,認證端口號為1812。
primary authentication 10.1.1.1 1812
#配置與認證服務器交互報文時的共享密鑰為明文expert。
key authentication simple expert
#配置向RADIUS服務器發送的用戶名要攜帶域名。
user-name-format with-domain
quit
#創建ISP域bbb,為login用戶配置AAA認證方法為RADIUS認證/授權、不計費。
domain bbb
authentication login radius-scheme rad
authentication login radius-scheme rad
accounting login none
quit
3.驗證配置。
用戶向switch發起SSH連接,按照提示輸入用戶名和密碼,可成功登錄switch。
銳捷
1.創建Radius服務器,并設置相關參數。
config radius add 1 192.168.1.111 key 123456 default #添加radius服務器,地址為192.168.1.111,交換機和radius服務器之間的密鑰為123456,認證UDP端口號為1812,超時時間為5秒,重新傳輸值為2。
2.全局啟用AAA。
enable auth-policy #全局啟用AAA。
3.創建login方法列表,并設置認證首選方法為Radius認證,第二方法為交換機本地認證。
create authen_login method_list_name ruijie #創建一個名為“ruijie”的用戶定義Login方法列表。
config authen_login method_list_name ruijie method radius local #配置Login方法列表“ruijie”的首選認證方法為“radius”,次選認證方法為交換機本地認證。
4.設置特權密碼ruijie,用于認證需要獲取admin權限的用戶。
config admin local_enable #配置管理員的本地啟用密碼。
5.配置HTTP用戶的認證所采用的認證方法列表為步驟3中創建的ruijie方法列表。
config authen application http login method_list_name ruijie # 配置HTTTP用戶采用“ruijie”認證方法列表。
6.交換機本地設置user級別的HTTP用戶賬號。
create web_account user 1 #創建Web帳號,用戶名為1,訪問權限為“user”。
7.配置radius服務器。
1)添加交換機的IP、Key值。
2)創建登入交換機的用戶名和密碼。
8.驗證配置。
在PC的WEB流量器上輸入URL“192.168.1.200”嘗試登錄交換機。