華為配置SSH登陸詳細步驟


理解下SSH登錄的過程:

1、建立目的端口為22的TCP連接

2、協商SSH版本

3、協商密鑰和算法

4、會話建立

 

下面為server端的詳細配置步驟:

1、創建本地RSA密鑰對

   rsa local-key-pair creat  //產生RSA本地密鑰對

2、配置vty界面支持的登錄協議

   user-interface vty 0 4

   authentication-mode aaa    //驗證方式為aaa

   protocol inbound {ssh|all} //這里選擇ssh或ALL都可

Noticifation:

   必須配置VTY用戶界面的驗證方式為AAA,不然protocol inbound ssh配置不成功

3、ssh user xxx    //創建SSH用戶xxx

4、ssh user xxx authentication-type {all|password|password-rsa|rsa}

   //配置用戶xxx的認證方式

下面開始按認證方式的不同進行不同的配置操作

4.1、配置認證方式為password

     ssh user xxx authentication-type password

     //該命令適用於本地認證或HWTACACS認證的用戶數量較少的情況下

     否則用下面的命令

     ssh authentication-type default password

     //設置所有用戶默認的認證方式為password

4.2、配置認證方式為RSA

     ssh user xxx authentication-type rsa

     rsa peer-public-key yyy //進入公鑰yyy的視圖

     public-key-code begin //進入公鑰編輯視圖

     輸入合法的密鑰編碼hex-data,編輯公共密鑰

     public-key-code end //退出公鑰編輯視圖,這是在hex-data輸入合法后,將生成密鑰

     ssh user xxx assign rsa-key yyy  //為SSH用戶分配公鑰yyy

 

如果創建的認證方式為password或password-rsa的SSH用戶

     則需要在AAA視圖下創建同名的local-user用戶

     1、aaa

     2、local-user xxx password cipher *******

     3、local-user xxx service-type ssh (不要設置成all,否則ssh進去還要用戶密碼)

此外需要開啟一些服務

     ssh user xxx service-type {sftp|stelnet|all} //配置SSH用戶的服務方式

     stelent server enable

     sftp server enable

     commit  //提交配置


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM