close
使用SSH的時候,一個數字證書將認證用戶端和網路設備之間的連接,並加密受保護的口令。
加密演算法包括Blowfish,資料加密標準(DES),以及3DES。
SSH保護並且有助於防止欺騙,“中間人”攻擊,以及資料包監聽。
SSH1使用RSA加密密鑰
SSH2使用數位簽名演算法(DSA)密鑰保護連接和認證
設定
Router(config)#hostname TEST 主機名稱一定要改,不可以用預設.
TEST(config)#ip domain-name TEST 設定 domain-name
要啟用SSH伺服器,你首先必須利用下面的命令產生一對RSA密鑰:
※在路由器上產生一對RSA密鑰就會自動啟用SSH.如果你刪除這對RSA密鑰,就會自動禁用該SSH伺服器。
TEST(config)#crypto key generate rsa 啟動本地ssh-server並產生RSA-KEY.
The name for the keys will be: TEST.TEST
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]:
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
(在此時重新產生並不會對現有連線造成中斷)
實施SSH的最後一步是啟用認證,授權和審計(AAA)。
在你配置AAA的時候,請指定用戶名和口令,會話超時時間,一個連接允許的嘗試次數
TEST(config)# aaa new-model
TEST(config)# username Cisco password Cisco
TEST(config)# ip ssh time-out
TEST(config)# ip ssh authentication-retries
強制在AAA配置過程中添加的用戶使用SSH,而不是Telnet
也可以在虛擬終端(vty)連接中應用SSH而實現同樣的目的
TEST(config)#line vty 0 4 進入遠端登入管理模式
TEST(config-line)#transport input ssh 僅開放 ssh 存取
TEST(config-line)#login local 使用本地驗證資料庫
全站熱搜