三、若何在路由器上设置sshCisco装备上利用ssh替换telnet尝试
第一步:建立当地的身份考证数据库
R3(config)#aaa
new-model
R3(config)#aaa
authentication
login
ssh
local
挑选身份考证由当地考证,起个名字叫ssh
R3(config)#username
aa
secret
aa1
建立当地用户名aa密码aa1的账户
第二步:设备telnet登陆考证采用aaa
的当地local考证
R3(config)#line
vty
0
4
R3(config-line)#login
authentication
ssh
R3(config-line)#transport
input
ssh
设备vty只接收ssh登陆他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
第三步:设置ssh加密密钥
R3(config)#ip
domain-name
cisco.com
设备一个路由器的域名
R3(config)#crypto
key
generate
rsa(利用rsa散列算法)
The
name
for
the
keys
will
be:
R3.cisco.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]:(默许密钥长度为512位)
%
Generating
512
bit
RSA
keys,
keys
will
be
non-exportable...[OK]
R3(config)#
Mar
25
01:20:22.359:
%SSH-5-ENABLED:
SSH
1.99
has
been
enabled
天生一个ssh的密钥
测试,从R1登陆R3,利用用户名aa,密码aa1登陆
R1#ssh
-l
aa
20.0.0.2
Password:
R3>en
Password:
R3#
摘自
http://www.cuisir.org/ciscolab/05.html