Error Could Not Load Host Key /usr/local/etc/ssh_host_key
Contents |
2 Comments Question: When I try to SSH to a remote server, SSH client fails with "Connection closed by X.X.X.X". On the SSH server side, I see error could not load host key /etc/ssh/ssh_host_ecdsa_key aix messages: "sshd error: could not load host key." What is going on, and how
Could Not Load Host Key /etc/ssh/ssh_host_dsa_key
can I fix this error? The detailed symptom of this SSH connection error is as follows. SSH client side: when you could not load host key: /etc/ssh/ssh_host_ed25519_key attempt to SSH to a remote host, you don't see login screen, and your SSH connection is closed right away with a message: "Connection closed by XXXX" or "Connection reset by XXXX" SSH server side:
Could Not Load Host Key /etc/ssh_host_rsa_key Mac
in a system log, you see the following error messages. In /var/log/auth.log on Debian, Ubuntu or Linux Mint: Oct 16 08:59:45 openstack sshd[1214]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key Oct 16 08:59:45 openstack sshd[1214]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key Oct 16 08:59:45 openstack sshd[1214]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Oct 16 08:59:45 openstack sshd[1214]: fatal: No supported key exchange algorithms [preauth] In /var/log/secure on CentOS, disabling protocol version 1. could not load host key Fedora or RHEL: Feb 18 21:48:25 localhost sshd[14226]: fatal: No supported key exchange algorithms [preauth] The root cause of this problem is that sshd daemon somehow is not able to load SSH host keys. When OpenSSH server is first installed on Linux system, SSH host keys should automatically be generated for subsequent use. If, however, key generation was not finished successfully, that can cause SSH login problems like this. Let's check if SSH host keys are found where they should be. $ ls -al /etc/ssh/ssh*key If SSH host keys are not found there, or their size is all truncated to zero (like above), you need to regenerate SSH host keys from scratch. Regenerate SSH Host Keys On Debian, Ubuntu or their derivatives, you can use dpkg-reconfigure tool to regenerate SSH host keys as follows. $ sudo rm -r /etc/ssh/ssh*key $ sudo dpkg-reconfigure openssh-server On CentOS, RHEL or Fedora, all you have to do is to restart sshd after removing existing (problematic) keys. $ sudo rm -r /etc/ssh/ssh*key $ sudo systemctl restart sshd An alternative way to regenerate SSH host keys is to manually generate them using ssh-keygen command. $ sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key $ sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key $ sudo ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecds
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site
Error Could Not Load Host Key Etc Ssh Ssh_host_dsa_key Rhel 7
About Us Learn more about Stack Overflow the company Business Learn more about hiring
Disabling Protocol Version 2. Could Not Load Host Key
developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a unknown key type ecdsa question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers http://ask.xmodulo.com/sshd-error-could-not-load-host-key.html are voted up and rise to the top Error `could not load host key` when trying to recreate SSH host keys up vote 5 down vote favorite 1 I am trying to recreate the ssh-server host keys. I have at least two ways to do this: With dpkg-reconfigure dpkg-reconfigure openssh-server This works fine, but I cannot give the key length then. I want for example 4096 for the http://askubuntu.com/questions/600584/error-could-not-load-host-key-when-trying-to-recreate-ssh-host-keys RSA key. Manually with ssh-keygen sudo ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N 'myverylongpasswordhere' -b 4096 -t rsa This recreates me the keys, but after restarting the server, I receive the following error message: could not load host key: /etc/ssh/ssh_host_rsa_key so I checked the sshd_config file whats in there: HostKey /etc/ssh/ssh_host_rsa_key matches perfectly. So, I checked the owner and rights to all my keys -rw------- 1 root root 3326 Mär 24 08:57 ssh_host_rsa_key When I remove all keys and recreate them with dpkg-reconfigure openssh-server, the keys are smaller and having the same file-rights like above. Question: How can I use dpkg-reconfigure with keylengh 4096 for RSA? ssh openssh share|improve this question edited Mar 24 '15 at 19:10 LiveWireBT 16k114895 asked Mar 24 '15 at 8:05 Emil Sommer 2813 Please run sshd in debug mode from the command line (sudo sshd -d) for more info on the issue and post the output. –David Foerster Mar 24 '15 at 9:44 @DavidFoerster That looks like a good suggestion. I tried recreating the issue by moving my keys temporarily, creating new keys with passwords, stopping and restarting... I don't get the error message of the OP. This is the result I get livewire
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more http://superuser.com/questions/880702/could-not-load-host-key-etc-ssh-host-key about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: https://ubuntuforums.org/showthread.php?t=2071536 Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Could not load host key: /etc/ssh_host_*_key up vote 1 down vote favorite When doing could not this check: $ /usr/sbin/sshd -t Getting: Could not load host key: /etc/ssh_host_rsa_key Could not load host key: /etc/ssh_host_dsa_key But when doing same check with sudo all is good: $ sudo /usr/sbin/sshd -t $ Does anyone know why does this happen, what’s wrong with my standard user and how to fix it? linux osx ssh share|improve this question edited Dec 31 '15 at 11:37 Mateusz Piotrowski 545219 asked Feb 21 '15 at 7:25 Drew 4572621 When you could not load are getting the error, are you running sshd as root? –Kenster Feb 21 '15 at 21:56 No as it's posted –Drew Feb 21 '15 at 22:32 I posted an answer, but what are you trying to do? sshd needs to be run by a user with root/sudo access. Not a regular user. –JakeGould Feb 21 '15 at 22:42 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Does anyone know why does this happen, what’s wrong with my standard user and how to fix it? There is nothing wrong; you are attempting to run sshd (SSH daemon) as a non-privileged user. For example, I am on Mac OS X 10.9.5 (Mavericks) and get the same exact “error” when running /usr/sbin/sshd -t: Could not load host key: /etc/ssh_host_rsa_key Could not load host key: /etc/ssh_host_dsa_key Which is to be expected since sshd is the SSH daemon—note the d after ssh—that would run as a SSH server on the system listening and waiting for remote SSH login requests. So it would always need root/sudo permissions to work. So this is not an “error” but rather expected behavior when attempting to run a system daemon like sshd as a non-privileged user. Perhaps you are trying to run ssh -t? As the man page for the ssh -t option explains: Force pseudo-tty allocation. This can be used
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] SSH error: Could not load host key. Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 8 of 8 Thread: SSH error: Could not load host key. Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode October 15th, 2012 #1 eng30312 View Profile View Forum Posts Private Message First Cup of Ubuntu Join Date Oct 2012 Beans 3 SSH error: Could not load host key. I am trying to break free of MS server and become proficient with Linux, and I've been doing pretty well so far, but this error has me stumped. I have searched high and low for a fix to this error, and while I have found many fixes, they simply aren't working for me. I keep running up against the same problem. OpenSSH reports "Could not load host key". WHY? I am running 10.04 LTS and installed OpenSSH. Here is my sshd_config file Code: cat /etc/ssh/sshd_config # Package generated configuration file # See the sshd_config(5) manpage for details # What ports, IPs and protocols we listen for Port 1031 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: ListenAddress 0.0.0.0 Protocol 2 # HostKeys for protocol version 2 HostKey /etc/ssh/dino_pub #Privilege Separation is turned on for secu