[Cisco] 用 SSH 登入 Cisco Switch

进入设定模式

switch#configure terminal switch(config)#

基本设定

设定 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。

启用 SSH 连线
switch(config)#ip ssh version 2
设定 SSH 连入的 VTY
switch(config)#line vty 0 4switch(config-line)#login localswitch(config-line)#transport input ssh
设定使用者帐号
switch(config)#username davis privilege 15 secret !QAZ2wsx switch(config)#endswitch#show running-config | inc usernameusername davis privilege 15 secret 5 $1$nnv4$aGGPZloMzWBfdt04QNco51

在 Cisco switch 上设定帐号时,建议使用 secret 的方式设定密码,避免密码被破解。

Done


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章