华三交换机,只配置ssh登录,但是一直登不上,远程显示connection closed by remote host,目标交换机上报警 ssh user disconnected form the server。这个该怎么弄
(0)
· 配置AC 1作为SFTP客户端,用户能够通过AC 1安全地登录到AC 2上,并被授予用户角色network-admin进行文件管理和文件传送等操作。
· AC 2作为SFTP服务器采用publickey认证方式对SFTP客户端进行认证,使用的公钥算法为RSA。
图15 设备作为SFTP客户端配置组网图
在服务器的配置过程中需要指定客户端的公钥信息,因此建议首先完成客户端密钥对的配置,再进行服务器的配置。
(1) 配置SFTP客户端
# 配置VLAN接口2的IP地址。
<AC1> system-view
[AC1] interface vlan-interface 2
[AC1-Vlan-interface2] ip address 192.168.0.2 255.255.255.0
[AC1-Vlan-interface2] quit
# 生成RSA密钥对。
[AC1] public-key local create rsa
The range of public key size is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
........................++++++
...................++++++
..++++++++
............++++++++
Create the key pair successfully.
# 将生成的RSA主机公钥导出到指定文件pubkey中。
[AC1] public-key local export rsa ssh2 pubkey
[AC1] quit
客户端生成密钥对后,需要将保存的公钥文件pubkey通过FTP/TFTP方式上传到服务器,具体过程略。
(2) 配置SFTP服务器
# 生成RSA密钥对。
<AC2> system-view
[AC2] public-key local create rsa
The range of public key size is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
........................++++++
...................++++++
..++++++++
............++++++++
Create the key pair successfully.
# 生成DSA密钥对。
[AC2] public-key local create dsa
The range of public key size is (512 ~ 2048).
If the key modulus is greater than 512, it will take a few minutes.
Press CTRL+C to abort.
Input the modulus length [default = 1024]:
Generating Keys...
.++++++++++++++++++++++++++++++++++++++++++++++++++*
........+......+.....+......................................+
...+.................+..........+...+
Create the key pair successfully.
# 生成ECDSA密钥对。
[AC2] public-key local create ecdsa secp256r1
Generating Keys...
.
Create the key pair successfully.
# 启动SFTP服务器。
[AC2] sftp server enable
# 配置VLAN接口2的IP地址,客户端将通过该地址连接SSH服务器。
[AC2] interface vlan-interface 2
[AC2-Vlan-interface2] ip address 192.168.0.1 255.255.255.0
[AC2-Vlan-interface2] quit
# 从文件pubkey中导入远端的公钥,并命名为ackey。
[AC2] public-key peer ackey import sshkey pubkey
# 设置SSH用户client001的服务类型为SFTP,认证方式为publickey,并指定公钥为ackey。
[AC2] ssh user client001 service-type sftp authentication-type publickey assign publickey ackey
# 创建设备管理类本地用户client001,并设置服务类型为SSH,用户角色为network-admin,工作目录为cfa0:/。
[AC2] local-user client001 class manage
[AC2-luser-manage-client001] service-type ssh
[AC2-luser-manage-client001] authorization-attribute user-role network-admin work-directory cfa0:/
[AC2-luser-manage-client001] quit
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论