1. 設置設備域名CISCO
ip domain name CISCO
2.創建密鑰
Server(config)#crypto key generate rsa
The name for the keys will be: Server.test.com
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]: 2048 #設置秘鑰長度
% Generating 2048 bit RSA keys, keys will be non-exportable...
[OK] (elapsed time was 7 seconds)
3.設置本地用戶登陸與密碼
username xxxx secret cisco
4.配置VTY
line vty 0 4
transport input ssh
5.設置SSH設置
Server(config)#ip ssh time-out 120 #ssh超時時間
Server(config)#ip ssh authentication-retries 2 #ssh認證失敗的次數
Server(config)#ip ssh version 2 #ssh的版本
Server(config)#ip ssh source-interface fastEthernet 0/0 #指定接口如果有vlan也可以,當指定接口后設備上的其他接口就不能被ssh