思科路由器ssh配置
今天给各位分享思科路由器ssh配置的知识,其中也会对思科交换机配置ssh登录进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站
本文内容目录一览:
cisco 路由器如何配置SSH
配置SSH config#hostname tangconfig#ip domain-name cisco.com 在生成加密密码时需要用到用户名和域名(config)#crypto key generate rsa general-keys modulus 1024 为加密会话产生加密密钥config#ip ssh time-out 1-120 设置ssh最大空闲定时器config#ip ssh authentication-retries 0-5 为ssh连接设计最大失败尝试值config#ip ssh version 2(config)#username cisco privilege 15 secret 0 cisco 设置用户名和密码 config#Line vty 0 4config-line#Login localconfig-line#Exec-timeout 60 0config-line#Logging synchronousconfig-line#transport input ssh telnet 配置事例:RouterenRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#line con 0Router(config-line)#exec-t 60 0Router(config-line)#password ciscoconRouter(config-line)#logg synchRouter(config-line)#exitRouter(config)#enable secret ciscoexecRouter(config)#no ip domain-lookupRouter(config)#hostname tangtang(config)#ip domain-name cisco.comtang(config)#username ciscossh privi 15 secret 0 ciscosshtang(config)#crypto key gen rsa gen modu 1024The name for the keys will be: tang.cisco.com % The key modulus size is 1024 bits% Generating 1024 bit RSA keys, keys will be non-exportable...[OK] tang(config)#*Jul 12 03:20:16.183: %SSH-5-ENABLED: SSH 1.99 has been enabledtang(config)#ip ssh time 60tang(config)#ip ssh auth 5tang(config)#ip ssh ver 2tang(config)#int gig 0/2tang(config-if)#ip add 192.168.110.1 255.255.255.0tang(config-if)#no shuttang(config-if)#*Jul 12 03:21:24.455: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to downtang(config-if)#*Jul 12 03:21:24.455: %ENTITY_ALARM-6-INFO: CLEAR INFO Gi0/2 Physical Port Administrative State Down *Jul 12 03:21:24.455: %ENTITY_ALARM-6-INFO: ASSERT CRITICAL Gi0/2 Physical Port Link Down tang(config-if)#*Jul 12 03:21:30.683: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to uptang(config-if)#*Jul 12 03:21:30.683: %ENTITY_ALARM-6-INFO: CLEAR CRITICAL Gi0/2 Physical Port Link Down *Jul 12 03:21:31.683: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to uptang(config-if)#tang(config-if)#exittang(config)#line vty 0 4tang(config-line)#login local% Login disabled on line 2, until 'password' is set% Login disabled on line 3, until 'password' is set% Login disabled on line 4, until 'password' is set% Login disabled on line 5, until 'password' is set% Login disabled on line 6, until 'password' is settang(config-line)#exec-t 60 0tang(config-line)#logg synchtang(config-line)#transport input ssh telnet SSH登录的用户名和密码为username命令所设置 注意路由器的IOS应该支持SSH才可以配置。一般k9的都支持
思科路由器(cisco)配置telnet登录和ssh登录应用举例
Telnet协议是TCP/IP协议族中的一员,是Internet远程登录服务的标准协议和主要方式。它为用户提供了在本地计算机上完成远程主机工作的能力。在终端使用者的电脑上使用telnet程序,用它连接到服务器。终端使用者可以在telnet程序中输入命令,这些命令会在服务器上运行,就像直接在服务器的控制台上输入一样。可以在本地就能控制服务器。
SSH 为 Secure Shell 的缩写,由 IETF 的网络小组(Network Working Group)所制定;SSH 为建立在应用层基础上的安全协议。SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。SSH最初是UNIX系统上的一个程序,后来又迅速扩展到其他操作平台。SSH在正确使用时可弥补网络中的漏洞。SSH客户端适用于多种平台。几乎所有UNIX平台—包括HP-UX、Linux、AIX、Solaris、Digital UNIX、Irix,以及其他平台,都可运行SSH。
思科telnet/ssh登录配置案例:
要求:
R2可以telnet R1
R3可以ssh R2
配置AR1
R1(config)#enable password 123
R1(config)#line vty 0 4
R1(config-line)#password 123
R1(config-line)#login
R1(config-line)#transport input telnet
R1(config)#interface ethernet 0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
配置AR2
Router(config)#interface ethernet 0/1
Router(config-if)# ip address 192.168.12.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface ethernet 0/0
Router(config-if)#ip address 192.168.13.2 255.255.255.0
Router(config-if)#no shutdown
Router#telnet 192.168.12.1 //telnet R1
Trying 192.168.12.1 ... Open
User Access Verification
Password:
R1enable
Password:
R1#exit
[Connection to 192.168.12.1 closed by foreign host]
又回到R2
Router(config)#hostname R2
R2(config)#ip domain name
R2(config)#crypto key generate rsa modulus 1024
The name for the keys will be: R2.
% The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be non-exportable...
[OK] (elapsed time was 0 seconds)
R2(config)#username glab1 secret glab1
R2(config)#line vty 0 4
R2(config-line)#login local
R2(config-line)#transport input ssh
R2(config)#enable password 123
R2(config)#
R2(config)#do show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 192.168.13.2 YES manual up up
Ethernet0/1 192.168.12.2 YES manual up up
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
R2(config)#
配置AR 3
Router(config)#hostname R3
R3(config)#interface ethernet 0/1
R3(config-if)#ip address 192.168.13.2 255.255.255.0
R3(config-if)#no shutdown
ssh R2开始
R3#ssh -l glab1 192.168.13.2
Password:
Password:
R2
Cisco 交换机/路由器 ssh 怎么 配置
1、设置域名:Router (config)# ip domain-name abc.com
2、配置加密方式为RSA:Router (config)# crypto key generate rsa
3、开启AAA认证:Router (config)# aaa new-model
4、设置客户吗与密码:Router (config)# username test password test
5、设置SSH超时:Router (config)# ip ssh time-out
6、开启SSH认证:Router (config)# ip ssh authentication-retries
7、进入Telnet接口配置模式:Router (config)# line vty 0 4
8、在Telnet接口模式下使用SSH认证:Router (config-line)# transport input SSH
9、若要用SSH2,配置SSH的版本号:Router (config)#ip ssh version 2
如何用思科路由器ssh 其他路由器
在Cisco路由器产品系列中只有7200系列、7500系列和12000系列(GSR)等高端产品的IOS支持SSH。一般支持SSH的IOS版本文件名中都带有K8或者K8字样,K8 代表56bit SSH 加密,k9代表168bit SSH加密。
目前Cisco的产品只支持SSH-1,还不支持SSH-2。下面以GSR 12008为例详细介绍SSH-1的配置方法(斜体字为配置输入的命令):
① 配置hostname和ip domain-name:
Router#configure terminal
Router(config)#hostname TEST-GSR12008
TEST-GSR12008(config)#ip domain-name jx.cn.net
② 配置登录用户名和密码(以本地认证为例):
TEST-GSR12008(config)#username test password 0 test
注:添加一个用户:test,口令:test
TEST-GSR12008(config)#line vty 0 4
TEST-GSR12008(config-line)#login local
在这两部分做完以后,用show run命令就能够看到:
hostname TEST-GSR12008
!
boot system flash gsr-k3p-mz.120-14.S.bin
enable secret 5 $1$DMyW$gdSIOkCr7p8ytwcRwtnJG.
enable password 7 094F47C31A0A
!
username test password 7 0835495D1D
clock timezone PRC 16
redundancy
main-cpu
auto-sync startup-config
!
!
!
!
ip subnet-zero
no ip finger
ip domain-name jx.cn.net
ip name-server 202.101.224.68
ip name-server 202.101.226.68
!
③ 配置SSH服务:
TEST-GSR12008(config)#crypto key generate rsa
The name for the keys will be: TEST-GSR12008.jx.cn.net
注:SSH的关键字名就是hostname + . +ip domain-name
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]: 注:选择加密位数,用默认就行了
Generating RSA keys …
[OK]
TEST-GSR12008(config)#end
TEST-GSR12008#write
Building configuration…
这时候用show run命令可以看到:
ip subnet-zero
no ip finger
ip domain-name jx.cn.net
ip name-server 202.101.224.68
ip name-server 202.101.226.68
ip ssh time-out 120
ip ssh authentication-retries 3
!
用命令show ip ssh也能看到:
SSH Enabled - version 1.5
Authentication timeout: 120 secs; Authentication retries: 3
现在SSH服务已经启动,如果需要停止SSH服务,用以下命令:
TEST-GSR12008(config)#crypto key zeroize rsa
④设置SSH参数
配置好了SSH之后,通过show run命令我们看到SSH默认的参数:超时限定为120秒,认证重试次数为3次,可以通过下面命令进行修改:
TEST-GSR12008(config)#ip ssh {[time-out seconds]} | [authenti
思科路由器ssh配置的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于思科交换机配置ssh登录、思科路由器ssh配置的信息别忘了在本站进行查找喔。