思科交换机SSH2远程登陆配置总结

1.1概述


本期文章主要总结分享思科交换机SSH2远程登陆配置、用户的密码如何在配置文件中显示为密文、NTP及时区配置和设备管理IP地址配置等,希望各位小伙伴有所收获。
思科交换机型号和版本:cisco WS-C2960-24TC-L、Version 12.2(55)SE7


1.2思科交换机SSH2远程登陆配置


#新设备,设备开机提示是否进入初始化配置,选择no即可直接进入用户视图
Would you like to enter the initial configuration dialog? [yes/no]: no
Switch>
#进入设备特权视图
Switch>enable 
Switch#
#进入设备全局视图,在全局视图下可进行设备的配置
Switch#configure terminal
#配置设备的名称
Switch(config)#hostname Cisco_SW
#配置设备enable登陆密码为admin1234@
Cisco_SW(config)#enable secret 5 admin1234@
#创建用户名和密码,在配置文件中该用户名的密码是明文
#该用户权限设置最高,使用该用户远程登陆该设备无需输入enable密码
Cisco_SW(config)#username admin privilege 15 password admin1234@
#在配置文件中,配置以下命令可实现登陆用户名对应密码变成密文
Cisco_SW(config)#service password-encryption
#关闭设备ip domain lookup功能
Cisco_SW(config)#no ip domain lookup 
#配置设备domain-name,它是配置SSH服务的前提条件
Cisco_SW(config)#ip domain-name Cisco_SW
#RSA的密钥至少768位才能启用SSH2,本次选择2048
#Please create RSA keys to enable SSH (of atleast 768 bits size) to enable SSH v2.
Cisco_SW(config)#crypto key generate rsa
The name for the keys will be: Cisco_SW. Cisco_SW
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]: 2048
% Generating 2048 bit RSA keys, keys will be non-exportable...[OK]
*Mar  1 00:18:37.328: %SSH-5-ENABLED: SSH 2.0 has been enabled
Cisco_SW(config)#
#启用SSH2服务
Cisco_SW(config)#ip ssh version 2   
#line vty中设置本地账户登陆
Cisco_SW(config)#line vty 0 15 
Cisco_SW(config-line)#login local 
#创建vlan 52
Cisco_SW(config)#vlan 52
# fastEthernet 0/1配置access类型并划分到vlan 52中
Cisco_SW(config)#interface fastEthernet 0/1
Cisco_SW(config-if)#switchport mode access 
Cisco_SW(config-if)#switchport access vlan 52
Cisco_SW(config-if)#exit
#创建三层虚拟接口并配置交换机的管理IP
Cisco_SW(config)#interface vlan 52
Cisco_SW(config-if)#ip address 192.168.52.1 255.255.255.0
#配置交换机管理IP的网关
Cisco_SW(config)#ip default-gateway 192.168.52.254
#指定NTP服务器的IP
Cisco_SW(config)#ntp server 192.168.52.254
#配置beijing的时区
Cisco_SW(config)#clock timezone beijing 8
#保存设备配置
Cisco_SW#write 
Building configuration...
[OK]
Cisco_SW#


1.3思科交换机常用命令


#查看设备版本、型号
Cisco_SW#show version 
#查看设备时钟
Cisco_SW#show clock
#查看设备NTP时钟同步状态
Cisco_SW #show ntp status
#查看设备接口的状态,接口IP、接口状态、接口协议状态等
Cisco_SW#show ip interface brief
#查看设备物理接口的状态、如协商速率、接口所属vlan等
Cisco_SW#show interfaces status 
#查看设备的MAC表项
Cisco_SW#show mac address-table
#查看设备的ARP表项
Cisco_SW#show arp 
#查看设备运行的配置
Cisco_SW#sho running-config
 

  • 2
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

onme0

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值