运维123 - 华三
type: channel
link: https://www.sddts.cn/index.php/category/%E5%8D%8E%E4%B8%89/
items: 华三交换机实现ssh public key登录

华三交换机实现ssh public key登录
type: item
date: 2024-03-29T06:14:00+00:00
description: 产生一个rsakeyssh-keygen -t rsa -b 2048 -f admin -C "admin" 注意：已有的linux里面的b可能是4096，交换机无法识别。通过web界面登录交换机管理界面，从文件管理中上传admin.pub新增本地admin账号local-user admin password cipher $c$3$6nilO+wOdgvkfAwZszmWLhLWOvV4fF5Is4IR authorization-attribute level 3 service-type ssh telnet terminal service-type ftp service-type web 导入刚刚web页面上传的admin.pubpublic-key peer admin import sshkey flash:/admin.pub配置admin账号使用public登录ssh，配置root使用密码登陆过 ssh server enable ssh user root service-type all authentication-type password ssh user admin service-type all authentication-type publickey assign publickey admin work-directory flash:/参考https://www.cnblogs.com/kscnchina/archive/2013/02/04/2892430.html