天天看點

H3C路由器登入管理

一、本地使用者Telnet登入管理(模拟器實驗)

1、在配置之前要添加一個以太網接口,預設是橋接到本地的網卡上(建議添加一個微軟的邏輯口,并禁用本地實體網卡,讓它橋接到邏輯接口上) 也可以編輯路由器的配置檔案“hardcfg.tcl”添加代碼“AddEthernet -index 1”,在啟動路由器即可!!

<H3C>format flash:    //要想儲存資料 ,必須格式化

All data on flash: will be lost , proceed with format ? [Y/N]:y

./

%Format flash: completed.

<H3C>system-view 

[H3C]telnet server enable    //啟動telnet服務

[H3C]password-control length 4   //預設密碼長度為10,這裡設為4

[H3C]local-user zzx     //添加一個使用者

New local user added.

[H3C-luser-zzx]password simple admin   //密碼

Updating user(s) information, please wait....

[H3C-luser-zzx]service-type telnet level 3   //服務類型 ,權限為3 即管理級别(有的是指令authorization-attribute level 3)

[H3C-luser-zzx]quit

[H3C]user-interface vty 0 4   //設定同時登入的使用者為5個

[H3C-ui-vty0-4]authentication-mode scheme   //驗證使用者名和密碼

[H3C-ui-vty0-4]quit

[H3C]inter Ethernet 0/1/0       //配置接口位址

[H3C-Ethernet0/1/0]ip add 192.168.10.10 255.255.255.0

<a href="http://blog.51cto.com/attachment/201303/183650771.png" target="_blank"></a>

預設情況下,使用者使用Telnet方式登入裝置,通過密碼驗證後,隻能使用級别為0的指令。 如果想使用1,2,3級别的指令可以配置super  password xxxx  來實作

或者通過驗證密碼

[H3C] user-interface vty 0 4

[H3C-ui-vty0-4] authentication-mode password

[H3C-ui-vty0-4] set authentication password cipher 123

[H3C-ui-vty0-4] user privilege level 2    //在這裡指明級别

二、本地使用者console登入管理

(不同之處)

[H3C-luser-zzx]service-type terminal    //設定服務類型為terminal

[H3C]user-interface con 0

[H3C-ui-vty0-4]authentication-mode scheme //設定scheme認證

三、SSH方式登入管理

1、驗證方式為pasword認證

[H3C]local-user zzx     //建立本地賬号

[H3C-luser-zzx]password simple zzx123   

[H3C-luser-zzx]service-type ssh   //服務類型為ssh

[H3C-luser-zzx]level 3     //級别為3

[H3C]ssh server enable   //開啟ssh服務  

[H3C]ssh user zzx service-type stelnet  authentication-type password  //SSH使用者client1的服務類型為stelnet,即安全Telnet,使用密碼認證方式

[H3C]public-key  local create rsa   //生成本地密鑰對并指定密鑰長度

The range of public key size is (512 ~ 2048).      

NOTES: If the key modulus is greater than 512,      

It will take a few minutes.     

Press CTRL+C to abort.

Input the bits of the modulus[default = 1024]:

Generating Keys...

...++..++...++..++...++...++...++..++.+++++++++.+++++++

連接配接一下看看如下;

<a href="http://blog.51cto.com/attachment/201303/183703271.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201303/183723120.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201303/183734754.png" target="_blank"></a>

2、驗證方式為公鑰認證

[H3C]public-key  local create rsa   //生成1024位的rsa本地密鑰對

&lt;H3C&gt;tftp 192.168.10.1 get Identity.pub   //導入公鑰.(公鑰是用Secure CRT軟體建立的)

  File will be transferred in binary mode 

  Downloading file from remote TFTP server, please wait...\

  TFTP:      360 bytes received in 0 second(s) 

  File downloaded successfully. 

 &lt;H3C&gt;dir

Directory of flash:/

 0     drw-         -  Mar 12 2013 13:11:12   logfile

 1     -rw-       360  Mar 12 2013 15:17:09   identity.pub

2540 KB total (2507 KB free)

[H3C]public-key peer sshpub import sshkey Identity.pub  //将導入的公鑰轉換為RSA格式sshpub

[H3C]ssh server enable  

[H3C]ssh user zzx service-type stelnet authentication-type publickey assign publickey sshpub

//SSH使用者zzx的服務類型為stelnet、使用公鑰認證,并且為該使用者名配置設定生成的公鑰sshpub

登入時 勾掉”密碼”這一項

<a href="http://blog.51cto.com/attachment/201303/183746425.png" target="_blank"></a>

四、radius進行telnet驗證

[H3C]telnet server enable   //打開Telnet伺服器,預設關閉,必須打開

[H3C]radius scheme telnetlogin  //建立RADIUS方案

[H3C-radius-telnetlogin]primary authentication 192.168.10.1   //配置驗證的伺服器位址與共享密鑰

[H3C-radius-telnetlogin]key authentication test

[H3C-radius-telnetlogin]user-name-format without-domain 

[H3C-radius-telnetlogin]server-type standard 

//Telnet使用者屬于Login類型,引用RADIUS方案test,不進行計費

[H3C]domain system

[H3C-isp-system]authentication login radius-scheme telnetlogin

[H3C-isp-system]authorization login radius-scheme  telnetlogin

[H3C-isp-system]accounting optional

//設定scheme認證

[H3C]user-interface vty 0 4

[H3C-ui-vty0-4]authentication-mode sch

[H3C-ui-vty0-4]authentication-mode scheme

在配置相應的接口

本文轉自 abc16810 51CTO部落格,原文連結:http://blog.51cto.com/abc16810/1152736

繼續閱讀