当前位置:网站首页>"Could not load host key" error when xshell connects to the server
"Could not load host key" error when xshell connects to the server
2022-07-27 00:17:00 【Ap21ril】
Record the problems encountered when configuring the edge server
Reprinted from :https://www.cnblogs.com/netonline/p/7410586.html
The phenomenon : start-up sshd The service , Although it seems that the service started successfully , But the client cannot connect sshd Server side . as follows :
[[email protected] ~]# /usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
reason :
- From the prompt message, it is sshd The daemons could not load the host key file , Because we can't find these key files ( The configuration file /etc/ssh/sshd_config Key file name and path... Are defined in );
- commonly openssh After normal service installation , The host will automatically generate the corresponding host key file , But this is not done for unknown reasons , It makes it impossible to remote ssh Connect .
ps: Check if the key file exists ( Another phenomenon is : Key file exists , But the file size is 0):
[[email protected] ~]# ll /etc/ssh/
total 252
-rw-r--r-- 1 root root 242153 Mar 21 22:18 moduli
-rw-r--r-- 1 root root 2208 Mar 21 22:18 ssh_config
-rw------- 1 root root 4361 Mar 21 22:18 sshd_config
Solution , Regenerate the host key file :
Generate rsa_key (-t Indicates the encryption type used by the generated key ;-f Item followed by the name of the key file to be generated );
[[email protected] ~]# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
5e:2d:19:51:b1:e3:e0:60:65:53:e4:14:f8:d8:38:af [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
| ==Bo |
| o.= . |
| o o=+ |
| . o+*o. |
| S =oo |
| . . .. |
| . . |
| E |
| |
+-----------------+
[[email protected] ~]# ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
Generate ecdsa_key;
[[email protected] ~]# ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
Generate ed25519_key.
[[email protected] ~]# ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
The last restart sshd
service ssh restart
Be accomplished
边栏推荐
- C and pointer Chapter 18 runtime environment 18.2 interface between C and assembly language
- What is Tencent cloud lightweight application server? What are the differences between CVM and ECS?
- push to origin/master was rejected 错误解决方法
- Deploy yolov5 error reporting in pycharm
- Upload files to OSS file server
- 11_ Weather case - monitoring properties
- Pytorch data pipeline standardized code template
- Relationship between limit, continuity, partial derivative and total differential of multivariate function (learning notes)
- SSRF (server side request forgery) -- Principle & bypass & Defense
- 第7章 课程总结
猜你喜欢

Leetcode topic - array

LeetCode——哈希表篇

信号与系统冲激响应与阶跃响应

deeplabcut使用1

Upload files to OSS file server

文件上传到OSS文件服务器

NFT display guide: how to display your NFT collection

Complete backpack and 01 Backpack
![Embedded system migration [8] - device tree and root file system migration](/img/af/5b5d38522f0cc434bdafbf892936ee.png)
Embedded system migration [8] - device tree and root file system migration

Go exceed API source code reading (IV) -- save (), SaveAs (name string)
随机推荐
Deep learning of parameter adjustment skills
机器学习模型——lightGBM
Deeplabcut uses 1
Design of vision protector based on 51 single chip microcomputer
What scenarios are Tencent cloud lightweight application servers suitable for?
动态sql
10_ Name Case - Calculation attribute
Complete backpack and 01 Backpack
Halloween treatments (drawer principle)
Identity server4 authorization successful page Jump encountered an error: exception: correlation failed Solution of unknown location
Training team lpoj round10 d come minion!
Blue Bridge Cup brush question notes (word analysis)
深度学习调参技巧
卷积神经网络——LeNet(pytorch实现)
三层架构 模拟
Practice of data storage scheme in distributed system
20220720 toss deeplobcut2
信号与系统冲激响应与阶跃响应
第1章 开发第一个restful应用
The place where the dream begins ---- first knowing C language (2)