华为交换机配置SSH ECC公钥登录并解决无法进入系统视图问题

  • 客户端生成ECC密钥对

ssh-keygen -t ecdsa -C backup-server

  • 交换机上导入ECC密钥
ecc peer-public-key backup-server encodint-type openssh
public-key-code begin
ecdsa-sha2-nistp256 AAAAE2vj............................. backup-server
public-key-code end
peer-public-key end
  • 交换机创建用户
aaa
local-user backup privilege level 15
local-user backup service-type ssh
quit
  • 为新创建的用户配置登录方式
ssh user backup assign ecc-key backup-server
ssh user backup service-type all
ssh user backup authentication-type ecc
  • 解决登录后无法进入系统视图的问题
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
user privilege level 15

如果没有这个配置会出现密码登录正常,公钥登录无法进入系统视图

Views: 0