思科路由器(cisco)配置telnet登录和ssh登录应用举例

如题所述

第1个回答  2022-07-12
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:

R1>enable

Password:

R1#exit

[Connection to 192.168.12.1 closed by foreign host]

又回到R2

Router(config)#hostname R2

R2(config)#ip domain name www.163.com

R2(config)#crypto key generate rsa modulus 1024

The name for the keys will be: R2.www.163.com

% 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>
相似回答