配置SSH服务器:
生成RSA密钥对,在提示“Y/N”的时候选择“Y”。
public-key local create rsa
y
生成DSA密钥对
public-key local create dsa
开启SSH服务器功能
ssh server enable
设置SSH客户端登录用户线的认证方式为AAA认证。
line vty 0 63(user-interface vty 0 63)
authentication-mode scheme
protocol inbound ssh(可选ssh、telnet、all)
user-role level-15(可选)
user-role network-admin(可选)
创建设备管理类本地用户为admin,密码为admin;并设置服务类型为SSH,用户角色为network-admin。
local-user admin class manage
password simple admin
service-type ssh
authorization-attribute user-role network-admin (和level-15任选一个)
authorization-attribute user-role level-15
配置用来ssh的地址
interface 接口
ip address 192.168.10.1 255.255.255.0
限制用户ssh登陆设备
acl basic 2000
rule permit source 192.168.10.0
quit
ssh server acl 2000
SSH客户端:
ssh2 192.168.10.1