摘自H3C官網(wǎng):http://www.h3c.com/cn/d_201803/1072475_30005_0.htm
?設(shè)備作為Stelnet服務(wù)器配置舉例(password認(rèn)證)
如圖1所示慨畸,網(wǎng)絡(luò)管理員需要通過Internet遠程登錄到校園網(wǎng)的網(wǎng)關(guān)設(shè)備(Device)上對其進行相關(guān)配置纺荧。為了提高對Device進行管理的安全性蚁袭,可將Device配置為Stelnet服務(wù)器寺旺,并在Host上運行Stelnet客戶端軟件蹋辅,在二者之間建立SSH連接柒瓣。要求:
·Device通過SSH的password認(rèn)證方式對客戶端進行認(rèn)證,認(rèn)證過程在Device本地完成;
·網(wǎng)絡(luò)管理員Host的登錄用戶名為client001名党,密碼為aabbcc,登錄設(shè)備后可以正常使用所有命令挠轴。
圖1 設(shè)備作為Stelnet服務(wù)器配置組網(wǎng)圖
·為了使SSH的版本協(xié)商和算法協(xié)商過程正常運行传睹,且為了保證客戶端對連接的服務(wù)器的認(rèn)證正常進行,請在服務(wù)器端生成RSA和DSA密鑰對岸晦。
·為了采用本地認(rèn)證的方式認(rèn)證用戶欧啤,需要在本地服務(wù)器Device上創(chuàng)建相應(yīng)的本地用戶,并在本地用戶視圖下配置密碼启上。
·Stelnet客戶端通過VTY用戶線訪問設(shè)備邢隧。因此,需要配置登錄用戶線的認(rèn)證方式為scheme方式冈在。
·為了使Stelnet用戶登錄設(shè)備后能正常使用所有命令倒慧,將用戶角色設(shè)置為network-admin,缺省情況下本地用戶的用戶角色為network-operator包券。
本舉例是在S5130EI_E-CMW710-R3106版本上進行配置和驗證的纫谅。
# 生成RSA密鑰對。
system-view
[Device] public-key local create rsa
The range of public key size is (512~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
........................++++++
...................++++++
..++++++++
............++++++++
Create the key pair successfully.
# 生成DSA密鑰對溅固。
[Device] public-key local create dsa
The range of public key size is (512~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
.++++++++++++++++++++++++++++++++++++++++++++++++++*
........+......+.....+......................................+
...+.................+..........+...+.
Create the key pair successfully.
# 使能SSH服務(wù)器功能付秕。
[Device] ssh server enable
# 創(chuàng)建VLAN 2,并將GigabitEthernet1/0/2加入VLAN 2侍郭。
[Device] vlan 2
[Device-vlan2] port gigabitethernet 1/0/2
[Device-vlan2] quit
# 配置VLAN接口2的IP地址询吴,客戶端將通過該地址連接Stelnet服務(wù)器。
[Device] interface vlan-interface 2
[Device-Vlan-interface2] ip address 192.168.1.40 255.255.255.0
[Device-Vlan-interface2] quit
# 設(shè)置Stelnet客戶端登錄用戶界面的認(rèn)證方式為scheme亮元。
[Device] line vty 0 63
[Device-line-vty0-63] authentication-mode scheme
[Device-line-vty0-63] quit
# 創(chuàng)建本地用戶client001猛计,并設(shè)置用戶密碼、服務(wù)類型和用戶角色爆捞。
[Device] local-user client001 class manage
New local user added.
[Device-luser-manage-client001] password simple aabbcc
[Device-luser-manage-client001] service-type ssh
[Device-luser-manage-client001]authorization-attribute user-role network-admin
[Device-luser-manage-client001] quit
#
vlan 2
#
interface Vlan-interface2
?ip address 192.168.1.40 255.255.255.0
#
interface GigabitEthernet1/0/2
?port access vlan 2
#
line vty 0 63
?authentication-mode scheme
#
ssh server enable
#
local-user client001 class manage
?password hash
$h$6$CqMnWdX6LIW/hz2Z$4+0Pumk+A98VlGVgqN3n/mEi7hJka9fEZpRZIpSNi9b
cBEXhpvIqaYTvIVBf7ZUNGnovFsqW7nYxjoToRDvYBg==
?service-type ssh
?authorization-attribute user-role network-admin
?authorization-attribute user-role network-operator
#