1.配置IP domain name
switch(config)#ip domain name 域名(test.com)
2.进入aaa中配置rsa
switch(config)#aaa new-model
switch (config)#crypto key generate rsa
此时会提示
The name for the keys will be: sw2960-15.xxx.com(test.com)
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]:
输入1024,回车。
3.配置SSH版本号,部分交换机可能无该命令
switch(config)#ip ssh version 2
4.配置通道协议,选择SSH协议,授权级别为15,管理员权限。
switch(config)#line vty 0 4
switch(config-line)#transport input ssh
switch(config-line)privilege level 15
switch(config-line)#login local
5.配置用户名和密码
sw2960-64 (config)#username admin(用户名) privilege 15 password XXXXX(密码)