iT邦幫忙

0

[Cisco] 用 SSH 登入 Cisco Switch

Davis 2020-04-13 06:35:4710902 瀏覽

進入設定模式

switch#configure terminal 
switch(config)#

基本設定

  1. 設定 domain name:
switch(config)#ip domain-name abc.com

註:其實這個 domain name 在實際使用 SSH 登入的時候是用不到的,所以甚至可以隨便取個名字都沒關係。
2. 設定 RSA 金鑰

switch(config)#crypto key generate rsa
% You already have RSA keys defined named switch.sysnet.cloud. 
% Do you really want to replace them? [yes/no]: yes 

Choose the size of the key modulus in the range of 360 to 4096 for your General Purpose Keys.
Choosing a key modulus greater than 512 may take a few minutes. 
How many bits in the modulus [512]: 1024 

% Generating 1024 bit RSA keys, keys will be non-exportable... 
[OK] (elapsed time was 0 seconds)

金鑰長度必須大於 1024 bits 才可以順利啟用 SSH v2。

  1. 啟用 SSH 連線
switch(config)#ip ssh version 2
  1. 設定 SSH 連入的 VTY
switch(config)#line vty 0 4
switch(config-line)#login local
switch(config-line)#transport input ssh
  1. 設定使用者帳號
switch(config)#username davis privilege 15 secret !QAZ2wsx 
switch(config)#end
switch#show running-config | inc username
username davis privilege 15 secret 5 $1$nnv4$aGGPZloMzWBfdt04QNco51

在 Cisco switch 上設定帳號時,建議使用 secret 的方式設定密碼,避免密碼被破解。

Done


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言