思科:配置ssh,交换机,路由器 |
您所在的位置:网站首页 › 华三交换机配置ssh远程登录 › 思科:配置ssh,交换机,路由器 |
配置ssh Switch>enable Switch#conf t Switch(config)#hostname s1//给设备改名字 S1(config)#int vlan 1// S1(config-if)#no shutdown 回车 S1(config-if)#ip address 1.1.1.2 255.255.255.0//配ip地址,网关 S1(config-if)exit//远程登录,进入特权模式 S1(config)#enable password 密码//使能加密口令(加密使能密码) 配ssh安全的远程访问 S1(config)#ip domain-name 名称//配置ip域名 S1(config)#crypto key//生成命域 S1(config)#crypto key generate rsa//生成,取消命运加密算法 回车默认512输入1024 S1(config)#username 用户名 password 密码//创建本地认证用户名称 S1(config)#line vty 0 15//虚线路,0开到最大15,总共16个终端 S1(config-line)#transport inqut ssh//线路下加载的协议inqut ssh S1(config-line)#login local//本地认证 S1(config-line)#exit//退出 S1(config)#ip ssh version 2//ssh的版本号2 电脑认证ssh Pc>ssh -1 名称 ip地址 回车输入密码 S1>enable//进入特权模式 输入密码,成功进入 配置交换机 配主机名称 Switch>enable Switch#conf t Switch(confing)#hostname S1 配置端口Fa0/1和接口vlan 99 S1(config)#interface fastEthernet 0/1 S1(config-if)#switchport mode access S1(config-if)#switchport access vlan 99 使用vlan 99 在S1上配置ip连通性 S1(config)#interface vlan 99 S1(config-if)#ip address 172.17.99.11 255.255.255.0 配置S1的默认网关 进入全局模式exit S1(config)#ip default-gateway172.17.99.1 使用帮助配置时钟end退回到S1# 将时钟配置为当前时间 S1#show clock S1#clock set 小时:分:秒 日期 月份(英文) 年 修改历史记录缓存 配置特权执行口令,配置控制台和telnet的口令 S1#conf t 进入全局模式 S1(config)#line console 0 S1(config-line)#history size 50// S1(config-line)#password 密码 S1(config-line)#login// Exit退出 S1(config)#line vty 0 15//虚线路0-15(开最大) S1(config-line)#history size 50 S1(config-line)#password 密码 S1(config-line)#login//密码终生有效 exit退出 S1(config)#enable secret 密码//设特权模式的密码 加密口令(弱加密保存) S1(config)#service password-encryption S1(config)#do show run//强行执行查看当前配置 配置聊天标语 S1(config)#banner motd “提示语” 配置路由器 Router>enable Router#conf t Router(config)#hostname R1 R1(config)#enable secret 密码 R1(config)#line console 0 R1(config-line)#password 密码 R1(config-line)#login//密码在登录时有效 R1(config-line)#history size 50//将控制台和vty的历史记录缓存均设置为50 R1(config-line)#exit R1(config)#line vty 0 15 R1(config-line)#history size 50 R1(config-line)#password 密码 R1(config-line)#login R1(config-line)#exit R1(config)#service password-encryption R1(config)#banner motd“提示语” 查看当前闪存中存储的文件 S1#show flash:文件路径 S1#conf t S1(config)#boot system flash:/文件路径 S1(config)#interface range fastEthernet 0/18,fastEthernet 0/24 S1(config-if-range)#speed 100//速度为100兆 S1(config-if-range)#duplex full//攻防模式,全双工 配置端口安全性(只允许一个端口通过) S1(config)#intrerface fastEthernet 0/18 S1(config-if)#switchport mode access S1(config-if)#switchport port-security S1(config-if)#switchport port-security mac-address sticky S1(config-if)#switchport port-security maximum 1���//绑定最大数量 S1(config-if)#switchport port-security violation shutdown 保护未使用端口的安全 Exit S1(config)#interface range fastEthernet 0/2-17,fastEthernet 0/19-23,gigabitEthernet 0/1-2 S1(config)#shutdown 保存存盘 S1(config-if-range)#end S1#copy running-config startup-config Ok S1#copy startup-config tftp:服务器地址 回车 S1# |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |