Cisco交换机配置远程登录

交换机配置远程登录

一、telnet远程登录

Telnet协议是TCP/IP协议族中的一员,是Internet远程登录服务的标准协议和主要方式(基于 TCP 的 23 号端口)

#使用用户名、密码进行远程登录
Switch>enable
Switch#configure terminal

#进入vlan 1,一般情况下vlan 1作为交换机的管理接
Switch(config)#int vlan 1

#设置IP地址192.168.1.100
Switch(config-if)#ip add 192.168.1.100 255.255.255.0
Switch(config-if)#no shut   
Switch(config-if)#exit
#telnet远程登录必须设置特权模式密码,如未设置,远程连接后无法进入特权模式D

#设置特权模式密文密码
Switch(config)#enable secret cisco

#创建登录用户名和密文密码
Switch(config)#username cisco secret cisco

#进人0-4虚拟终端
Switch(config)#line vty 0 4

#应用
Switch(config-line)#login local

二、SSH远程登陆

SSH 为 Secure Shell 的缩写,由IETF 的网络小组 (Network Working Group) 所制定; SSH 为建立在应用层基础上的安全协议。SSH 是较可靠,专为远程登录会话和其他网络服务提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。 (基于 TCP 的 22 号端口)

Switch>enable  
Switch#configure terminal  

Switch(config)#interface vlan 1   
Switch(config-if)#ip address 192.168.1.100 255.255.255.0   
Switch(config-if)#no shutdown  
Switch(config-if)#exit

#配置交换机hostname
Switch(config)#hostname test  

#启用v2版的ssh服务
test(config)#ip ssh version 2  

#配置交换机domain-name
test(config)#ip domain-name test.com  

#生成密钥
test(config)#crypto key generate rsa      
The name for the keys will be: test.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    //设置密钥位数
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

#配置特权模式密码(secret密码为加密的,password为明文的)

test(config)#enable  password admin  

#配置用户名和密码(secret密码为加密的,password为明文的)
test(config)#username admin secret admin  

#设置超时,单位秒

test(config)#ip ssh time-out 30

#设置认证次数
test(config)#ip ssh authentication-retries 32 3

#进入虚拟终端管理线路vty 0 4 
test(config)#line vty 0 4  

#只允许ssh登录
test(config-line)#transport input ssh  

#应用
test(config-line)#login local    
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Cityミ slaves

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

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

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

打赏作者

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

抵扣说明:

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

余额充值