栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

配置stelnet(ssh)登录交换机

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

配置stelnet(ssh)登录交换机

配置设备作为 STelnet 客户端登录其他设备示例

(适合华为交换机V200R020以及以后的版本如s5735-L24T4x-A1 2021年10月15日 )
步骤1 在服务器端生成本地密钥对
system-view
[HUAWEI] sysname SSH Server
[SSH Server] dsa local-key-pair create
Info: The key name will be: SSH Server_Host_DSA.
Info: The DSA host key named SSH Server_Host_DSA already exists.
Info: The key modulus can be any one of the following : 1024, 2048.
Info: If the key modulus is greater than 512, it may take a few minutes.
Please input the modulus [default=2048]:
Info: Generating keys…
Info: Succeeded in creating the DSA host keys.
步骤2 在服务器端创建SSH用户

配置VTY用户界面。

[SSH Server] user-interface vty 0 4
[SSH Server-ui-vty0-4] authentication-mode aaa
[SSH Server-ui-vty0-4] protocol inbound ssh
[SSH Server-ui-vty0-4] quit
● 创建SSH用户client001。

新建用户名为client001的SSH用户,且认证方式为password。

[SSH Server] aaa
[SSH Server-aaa] local-user client001 password irreversible-cipher Example@123
[SSH Server-aaa] local-user client001 privilege level 3
[SSH Server-aaa] local-user client001 service-type ssh
[SSH Server-aaa] quit
[SSH Server] ssh user client001
[SSH Server] ssh user client001 authentication-type password
步骤3 SSH服务器端开启STelnet服务功能

开启STelnet服务功能。

[SSH Server] stelnet server enable //使能STelnet服务器功能。V200R020及之后版本您还需要执行ssh server-source命令配置服务器端的源接口为10.1.1.1对应的接口,客户端才能通过10.1.1.1连接服务器。
[HUAWEI] http server-source -i MEth0/0/1(vlanif 1) //缺省情况下,设备默认将管理IP地址192.168.1.253配置
在管理网口或VLANIF1接口下,并将该接口设置为HTTP服务器端的源接口,且设备默认未指定HTTP服务器端的IPv6源地址。
Warning: The operation will reboot the HTTP server. Continue? [Y/N]:y

步骤4 配置SSH用户client001的服务方式为STelnet
[SSH Server] ssh user client001 service-type stelnet
步骤5 STelnet客户端连接SSH服务器

第一次登录,需要使能SSH客户端首次认证功能。

system-view
[HUAWEI] sysname client001
[client001] ssh client first time enable
步骤6 验证配置结果
在SSH服务器端执行display ssh server status命令可以查看到STelnet服务已经使能。
执行display ssh user-information命令可以查看服务器端SSH用户信息。

查看SSH状态信息。

[SSH Server] display ssh server status
SSH version :2.0
SSH connection timeout :60 seconds
SSH server key generating interval :0 hours
SSH authentication retries :3 times
SFTP server :Disable
Stelnet server :Enable
Scp server :Disable
SSH server source :0.0.0.0
ACL4 number :0
ACL6 number :0

查看SSH用户信息。

[SSH Server] display ssh user-information
User 1:
User Name : client001
Authentication-type : password
User-public-key-name : -
User-public-key-type : -
Sftp-directory : -
Service-type : stelnet
Authorization-cmd : No
User 2:
User Name : client002
Authentication-type : dsa
User-public-key-name : dsakey001
User-public-key-type : dsa
Sftp-directory : -
Service-type : stelnet
Authorization-cmd : No

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/388620.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号