华为交换机SSH报错Socket error Event: 32 Error: 10053. Connection closing...Socket close.

该文描述了在使用FutureMatrixS5735S-SSwitch时遇到的SSH连接问题,问题源于不支持的弱秘钥算法。解决方案包括加载WEAKEA插件,取消不安全的加密算法配置,更改SSH服务器源接口设置以及更新服务类型。警告提示表明这些操作可能带来的安全隐患。
摘要由CSDN通过智能技术生成

环境:

FutureMatrix S5735S-S Switch

Software Version : VRP ® Software, Version 5.170 (V200R021C01SPC200)

问题描述:

Xshell连接不上SSH 出现Socket error Event: 32 Error: 10053.
Connection closing…Socket close.

原因分析

SSH登录弱秘钥算法不支持问题

从V200R019C10SPC500开始交换机默认不支持sha2_256_96、sha1、sha1_96、md5和md5_96等参数导致低版本的客户端登录失败

解决方案:

手动加载WEAKEA插件

1.载入弱模块WEAKEA插件

load-module weakea

install-module weakea.mod

2.sy视图,取消之前配置

将指定的算法参数全部undo掉

[xx-core]

undo ssh server cipher
undo ssh server hmac
undo ssh server key-exchange
undo ssh server dh-exchange min-len
undo ssh server publickey
undo ssh client cipher
undo ssh client hmac
undo ssh client key-exchange

[xx-core]undo ssh server cipher
Warning: Insecure encryption algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh server hmac
Warning: Insecure digest algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh server key-exchange
Warning: Insecure key exchange algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh server dh-exchange min-len
Warning: Setting the minimum value of the Diffie-hellman-group-exchange key exchange algorithm to be less than 2048 imposes security risks.
[xx-core]undo ssh server publickey
Warning: Insecure encryption algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh client cipher
Warning: Insecure encryption algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh client hmac
Warning: Insecure digest algorithms are enabled. Disabling them is recommended.
[xx-core]undo ssh client key-exchange
Oct 25 2022 00:04:22 Soterea-core DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.56813.5.25.191.3.1 configurations have been changed. The current change number is 24, the change loop count is 0, and the maximum number of records is 4095.
[xx-core]undo ssh client key-exchange

3.更改source端口

输入:ssh server-source all-interface

[xx-core]ssh server-source all-interface
Warning: SSH server source configuration will take effect in the next login. Continue? [Y/N]:y
Warning: It expandes the range of accessed Ip.
[xx-core]
Oct 25 2022 00:07:31 Soterea-core LLDP/4/RATEEXCESSIVE:OID 1.3.6.1.4.1.56813.5.25.134.2.7 The rate of received PDUs exceeded the threshold. (IfName=GigabitEthernet0/0/1)

4.更新一下服务类型
ssh user admin service-type stelnet

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
下面是基于STM32和ESP8266采用MQTT方式连接华为云的代码: ``` #include <ESP8266WiFi.h> #include <PubSubClient.h> #include <SoftwareSerial.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #define WIFI_SSID "your_wifi_ssid" #define WIFI_PASSWORD "your_wifi_password" #define MQTT_SERVER "your_mqtt_server" #define MQTT_PORT 1883 #define MQTT_USERNAME "your_mqtt_username" #define MQTT_PASSWORD "your_mqtt_password" #define MQTT_TOPIC "your_mqtt_topic" SoftwareSerial espSerial(2, 3); // RX, TX WiFiClient wifiClient; PubSubClient mqttClient(wifiClient); LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { Serial.begin(115200); espSerial.begin(115200); lcd.begin(); lcd.backlight(); lcd.print("Connecting to WiFi"); WiFi.begin(WIFI_SSID, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { delay(500); lcd.setCursor(0, 1); lcd.print("."); } lcd.clear(); lcd.print("WiFi Connected"); mqttClient.setServer(MQTT_SERVER, MQTT_PORT); mqttClient.setCallback(mqttCallback); } void loop() { if (!mqttClient.connected()) { mqttReconnect(); } mqttClient.loop(); String temp = readTemperature(); mqttClient.publish(MQTT_TOPIC, temp.c_str()); lcd.setCursor(0, 0); lcd.print("Temp: "); lcd.print(temp); delay(1000); } void mqttReconnect() { while (!mqttClient.connected()) { Serial.println("Connecting to MQTT broker..."); if (mqttClient.connect("ESP8266", MQTT_USERNAME, MQTT_PASSWORD)) { Serial.println("MQTT connected"); mqttClient.subscribe(MQTT_TOPIC); } else { Serial.print("MQTT connection failed, rc="); Serial.print(mqttClient.state()); Serial.println(" retrying in 5 seconds"); delay(5000); } } } void mqttCallback(char* topic, byte* payload, unsigned int length) { Serial.print("Received message ["); Serial.print(topic); Serial.print("]: "); for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); } Serial.println(); } String readTemperature() { String temp; espSerial.println("AT+CIPSTART=\"TCP\",\"api.openweathermap.org\",80"); if (espSerial.find("OK")) { Serial.println("TCP connection established"); String request = "GET /data/2.5/weather?q=London,uk&APPID=your_api_key HTTP/1.1\r\nHost: api.openweathermap.org\r\nConnection: close\r\n\r\n"; espSerial.print("AT+CIPSEND="); espSerial.println(request.length()); if (espSerial.find(">")) { Serial.println("Sending request"); espSerial.print(request); if (espSerial.find("CLOSED")) { Serial.println("TCP connection closed"); } else { Serial.println("Error closing TCP connection"); } } else { Serial.println("Error sending request"); } } else { Serial.println("Error establishing TCP connection"); } return temp; } ``` 这段代码连接到Wi-Fi并建立MQTT连接,然后每秒钟读取温度并将其发布到MQTT主题“your_mqtt_topic”中。当接收到来自MQTT主题的消息时,它将在串行监视器中打印出来。请注意,您需要将代码中的"WIFI_SSID","WIFI_PASSWORD","MQTT_SERVER","MQTT_USERNAME","MQTT_PASSWORD"和"MQTT_TOPIC"替换为您自己的值。也需要更改“readTemperature”函数中的API密钥和查询参数,以获取您所需的实际温度值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

玩人工智能的辣条哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值