Could not load host key:/etc/ssh/ssh_host_rsa_key/etc/ssh/ssh_host_dsa_key problem

Source: Internet
Author: User
Could not load host key:/etc/ssh/ssh_host_rsa_key
Could not load host key:/etc/ssh/ssh_host_dsa_key
Solution to the problem

Symptoms:

When you start a sshd with a command/usr/sbin/sshd:

System prompts "Could not load host key:/etc/ssh/ssh_host_key

Could not load host key:/etc/ssh/ssh_host_rsa_key

Could not load host key:/etc/ssh/ssh_host_dsa_key

Disabling Protocol version 1. Could not load host key

Disabling Protocol version 2. Could not load host key

Sshd:no Hostkeys available-exiting "

The general meaning is to need a key or something.

The problem lies in:

1, the system lost Ssh_host_dsa_key and Ssh_host_rsa_key

2, the user does not have permission to access these two key

The solution is as follows:

1, the system lost two key:

Enter in Terminal: Ssh-keygen-t dsa-f/etc/ssh/ssh_host_dsa_key rebuild Ssh_host_dsa_key file

The following is the return information

Generating Public/private DSA key pair.

Enter passphrase (empty for No passphrase): (Direct return)

Enter same Passphrase again:

Your identification has been saved In/etc/ssh/ssh_host_dsa_key.

Your public key has been saved in/etc/ssh/ssh_host_dsa_key.pub.

The key fingerprint is:

Xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Root@localhost.localdomain

Enter in Terminal: Ssh-keygen-t rsa-f/etc/ssh/ssh_host_rsa_key rebuild Ssh_host_rsa_key file

The following is the return information

Generating public/private Rkey pair.

Enter passphrase (empty for No passphrase): (Direct return)

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_dsa_rey.pub.

Root@localhost.localdomain

Now use

/usr/sbin/sshd

You can start sshd successfully

At this point, you can use putty to connect to this Linux host under Windows.

2, the current user does not have the right time to use the command

/usr/sbin/sshd

This also happens when you start the sshd, so this is checking to see if it's root, and the average root user can perform this operation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.