技术解析
ssh-keygen -f .ssh/id_rsa.pub -e -m pem | grep -v '\-\-\-\-' | base64 -d | xxd -p #转换已有的rsa key
####交换机配置 rsa peer-public-key 1 public-key-code begin #此处是转换后的key数据 public-key-code end peer-public-key end # user-interface vty 0 4 authentication-mode aaa user privilege level 15 protocol inbound ssh # aaa local-user 用户名 password cipher 密码 privilege level 15 #local-user netadmin privilege level 15 local-user 用户名 service-type stelnet local-user 用户名 service-type ssh # stelnet server enable ssh user 用户名 authentication-type rsa ssh user 用户名 assign rsa-key 1 ssh user 用户名 service-type stelnet
user-interface vty 0 4 authentication-mode aaa protocol inbound ssh # aaa local-user 用户名 password cipher 密码 privilege level 15 local-user 用户名 service-type stelnet local-user 用户名 service-type ssh # stelnet server enable ssh user 用户名 authentication-type password ssh user 用户名 service-type stelnet