华为、华三、思科、锐捷网络设备远程登录配置 目录一、华为Stelnet登录配置二、华三Stelent登录配置三、思科SSH登录配置四、锐捷SSH登录配置一、华为Stelnet登录配置#查看SSH状态#[Server]dis ssh server statusSSH Version : 2.0SSH authentication timeout (Seconds) : 60SSH authentication retries (Times) : 3SSH server key generating interval (Hours) : 0SSH version 1.x compatibility : DisableSSH server keepalive : EnableSTELNET IPv4 server : DisableSTELNET IPv6 server : DisableSSH port forwarding : DisableSSH IPv4 server port : 22SSH IPv6 server port : 22#开启stelnet服务#[Server]stelnet server enableInfo: Succeeded in starting the STelnet server.Warning: After configuring the source interface or source address, the IPV4/IPV6 listening socket will be created.#再次查看SSH状态可以看到STELNET服务已开启#[Server]dis ssh server statusSSH Version : 2.0SSH authentication timeout (Seconds) : 60SSH authentication retries (Times) : 3SSH server key generating interval (Hours) : 0SSH version 1.x compatibility : DisableSSH server keepalive : EnableSTELNET IPv4 server : EnableSTELNET IPv6 server : EnableSSH port forwarding : DisableSSH IPv4 server port : 22SSH IPv6 server port : 22#在aaa视图下新建用户并设置密码#[Server-aaa]local-user admin password irreversible-cipher Huawei123Error: The username length must be greater than or equal to six characters.#如上错误提示是针对用户名的强校验此时需要关闭针对用户名的强校验#[Server-aaa]local-aaa-user user-name complexity-check disableWarning: Local user name complexity check has been disabled, there is a security risk.#再次新建用户并设置密码成功创建#[Server-aaa]local-user admin password irreversible-cipher Huawei123Info: The initial password of admin must be changed during login.#配置用户需要访问的服务类型#[Server-aaa]local-user admin service-type ?ftp FTP userhttp HTTP usersnmp Snmp userssh SSH usertelnet Telnet userterminal Terminal user[Server-aaa]local-user admin service-type ssh terminal telnet http#定义用户的级别#[Server-aaa]local-user admin privilege level 3Warning: This operation may affect online users and will change the user privilege level, Continue? [Y/N]:y#查看aaa视图下的完整配置#[Server-aaa]dis thisaaalocal-aaa-user user-name complexity-check disablelocal-user admin password irreversible-cipher $1d$kwi;UG~XFBS{a6w$myBP2oMUKOs,TOM|LN\1-ExSiYx-1zqn$.Wjk.W$local-user admin privilege level 3local-user admin service-type telnet terminal ssh http#在VTY视图下配置认证模式是基于aaa且访问协商是SSH#user-interface vty 0 4authentication-mode aaaprotocol inbound ssh#在全局定义SSH用户的认证方式和访问服务的类型#[Server]ssh user admin authentication-type passwordInfo: Succeeded in adding a new SSH user.[Server]ssh user admin service-type stelnet#默认下SSH服务的所有端口已关闭需要开启SSH服务的端口。部分版本没有默认关闭#undo ssh server-source all-interfaceundo ssh ipv6 server-source all-interface[Server]ssh server-source all-interface#在Client上进行Stelnet测试#[Client]stelnet 10.0.1.1Trying 10.0.1.1 ...Press CTRL K to abortConnected to 10.0.1.1 ...Error: Failed to verify the servers public key.Use command ssh client first-time enable enable first-timeor use -force-receive-pubkey option in this command and try again.Info: Session is disconnected.#如上提示报错则需要在Client端上开启如下功能。此只针对华为交换机需要针对PC终端或者友商产品可直接访问#[Client]ssh client first-time enable#在Client上再次进行Stelnet测试#[Client]stelnet 10.0.1.1Trying 10.0.1.1 ...Press CTRL K to abortConnected to 10.0.1.1 ...The servers key fingerprint is ssh-rsa 3072 O309N1uJOyBoKzCxFNqlysdjDJHmdsgu2pbOjDeBhg.The server is not authenticated. Continue to access it? [Y/N]: ySave the servers public key? [Y/N]: nPlease input the username: adminEnter password:Warning: The initial password poses security risks.The password needs to be changed, Continue? [Y/N]:nInfo: The connection was closed by the remote host.[Client]#如上提示需要修改密码选择Y就需要修改密码后登录选择N就直接关闭Stelnet连接。一般不想修改密码后登录则在Client登录Server前需要在Server的aaa视图下关闭强制修改密码功能。针对不同版本灵活处理。#[Server-aaa]local-user admin password-force-change disableWarning: Disabling thlocal-aaa-user user-name complexity-check disablelocal-user admin password irreversible-cipher $1d$kwi;UG~XFBS{a6w$myBP2oMUKOs,TOM|LN\1-ExSiYx-1zqn$.Wjk.W$local-user admin password-force-change disablelocal-user admin privilege level 3local-user admin service-type telnet terminal ssh http#在Client上再次进行Stelnet测试登录成功#[Client]stelnet 10.0.1.1Trying 10.0.1.1 ...Press CTRL K to abortConnected to 10.0.1.1 ...The servers key fingerprint is ssh-rsa 3072 O309N1uJOyBoKzCxFNqlysdjDJHmdsgu2pbOjDeBhg.The server is not authenticated. Continue to access it? [Y/N]: ySave the servers public key? [Y/N]: nPlease input the username: adminEnter password:Info: Password will expire in: 90 days.Info: The max number of VTY users is 5, the number of current VTY users online is 1, and total number of terminal users online is 2.The current login time is 2026-05-12 07:04:32.Server二、华三Stelent登录配置#生成本地密钥对根据实际选择模式#[SSH Server]public-key local create dsaThe range of public key modulus is (512 ~ 2048).If the key modulus is greater than 512, it will take a few minutes.Press CTRLC to abort.Input the modulus length [default 1024]:Generating Keys.....Create the key pair successfully.#H3C上Stelnet服务是与SSH服务关联的默认SSH服务关闭#[SSH Server]display ssh server statusSSH is not configured.#开启SSH服务#[SSH Server]ssh server enable#查看SSH服务且发现Stelnet服务已开启#[SSH Server]dis ssh server statusStelnet server: EnableSSH version : 2.0SSH authentication-timeout : 60 second(s)SSH server key generating interval : 0 hour(s)SSH authentication retries : 3 time(s)SFTP server: DisableSFTP Server Idle-Timeout: 10 minute(s)NETCONF server: DisableSCP server: Disable#创建设备管理类本地用户并设置密码服务访问类型及账户权限管理权限现网灵活调整#local-user admin class managepassword simple 密码service-type sshauthorization-attribute user-role network-adminlevel-15#建立SSH用户并指定SSH用户的认证方式可选不进行此配置也能正常ssh访问服务端#ssh user admin service-type stelnet authentication-type password#进入VTY用户线视图配置认证方式默认支持password方式scheme方式是需要有用户名和密码的如上已设置、支持协议默认是telnet和SSH不同设备灵活处理#line vty 0 4authentication-mode scheme#网络设备客户端直接访问SSH服务端#ssh 10.0.1.1Username: user1Press CTRLC to abort.Connecting to 10.0.1.1 port 22.The server is not authenticated. Continue? [Y/N]:yDo you want to save the server public key? [Y/N]:nuser110.0.1.1s password:Enter a character ~ and a dot to abort.******************************************************************************* Copyright (c) 2004-2022 New H3C Technologies Co., Ltd. All rights reserved.** Without the owners prior written consent, ** no decompiling or reverse-engineering shall be allowed. *******************************************************************************SSH Server三、思科SSH登录配置#生成本地密钥对根据实际选择模式#enconf tcrypto key generate rsa2048#开启SSH服务并设置版本其他SSH服务设置#conf tip ssh version 2ip ssh time-out 5#配置登录的用户名和密码#conf tusername uer1 privilege 15 password 密码#进入line视图声明使用本地用户登录#conf tline vty 0 4login localtransport input ssh#网络设备上登录SSH Server#Router#ssh -l user1 10.0.1.1Password:R1#四、锐捷SSH登录配置#开启SSH服务器功能#conf tenable service ssh-server#配置登录的用户名和密码#conf tusername 用户名 password 密码#在线路上开启本地用户认证#conf tline vty 0 4login local以上整理信息仅是个人经验总结如有出入烦请指正交流感谢