Error Could Not Load Host Key Ssh
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 error could not load host key /etc/ssh/ssh_host_ed25519_key the SSH server side, I see error messages: "sshd error: could not load
Error Could Not Load Host Key /etc/ssh/ssh_host_ecdsa_key
host key." What is going on, and how can I fix this error? The detailed symptom of this SSH could not load host key: /etc/ssh/ssh_host_ed25519_key connection error is as follows. SSH client side: when you attempt to SSH to a remote host, you don't see login screen, and your SSH connection is closed right away with
Docker Could Not Load Host Key: /etc/ssh/ssh_host_rsa_key
a message: "Connection closed by XXXX" or "Connection reset by XXXX" SSH server side: 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 error could not load host key etc ssh ssh_host_dsa_key rhel 7 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, 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
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 About Us Learn more about Stack Overflow the company
Could Not Load Host Key: /etc/ssh_host_rsa_key Mac
Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags
Disabling Protocol Version 1. Could Not Load Host Key
Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only could not load host key /etc/ssh/ssh_host_rsa_key ubuntu takes a minute: 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 Error `could not load host key` when trying to http://ask.xmodulo.com/sshd-error-could-not-load-host-key.html 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 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, http://askubuntu.com/questions/600584/error-could-not-load-host-key-when-trying-to-recreate-ssh-host-keys 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@za20:/etc/ssh$ sudo sshd -d output sshd re-exec requires execution with an absolute path Otherwise I would have included an example in my answer :( –LiveWireBT Mar 24 '15 at 18:47 Sorry, that should have been sudo /usr/sbin/sshd -d. The error you got is meant literally (though not quite clear). &nd
Sign in Pricing Blog Support Search GitHub This repository Watch 350 Star 4,756 Fork 626 dnschneid/crouton Code Issues 616 Pull requests 21 Projects 1 Wiki https://github.com/dnschneid/crouton/issues/1963 Pulse Graphs New issue OpenSSH startup: could not load host keys error #1963 Open aafrey opened this Issue Jul 24, 2015 · 3 comments Projects None yet Labels None yet https://bugs.launchpad.net/bugs/1005440 Milestone No milestone Assignees No one assigned 3 participants aafrey commented Jul 24, 2015 apologies if this is old new, but i;ve spent the better part of two days could not trying to get ssh started in crouton. I've followed the setup instructions found here: https://github.com/dnschneid/crouton/wiki/Running-servers-in-crouton but to no avail... my /etc/rc.local file looks like this: /sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT mkdir -p -m0755 /var/run/sshd /usr/sbin/sshd exit 0 when i run $service ssh start i get this error * Starting OpenBSD Secure Shell server sshd Could not load could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key [ OK ] i've regenerated and reconfigured everything multiple times to no avail. any help appreciated. thanks tista500 commented Aug 3, 2015 @aafrey, I haven't such issue in my OpenSSH-server. It would work well out of the box, maybe. :( So did you try re-install openssh-server and re-create ssh-key? Seahorse (a Gtk frontend for managing personal keys) would be useful if you had graphical desktop. Then if I remembered well, /etc/ssh/ directory and contents were generated automatically when we install a openssh-server properly. Regards. Collaborator drinkcat commented Aug 22, 2015 Which release is this on? IIRC these keys should be generated either at install time, or when the service is first started... Collaborator drinkcat commented Aug 22, 2015 This page is old but probably still relevant: https://www.digitalocean.com/company/blog/avoid-duplicate-ssh-host-keys/ . Try to run: /usr/sbin/dpkg-reconfigure openssh-server Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 Git
people Affects Status Importance Assigned to Milestone openssh (Ubuntu) Edit Confirmed Low Unassigned Edit You need to log in to change this bug's status. Affecting: openssh (Ubuntu) Filed here by: Michael Nagel When: 2012-05-28 Confirmed: 2012-09-07 Target Distribution Baltix BOSS Juju Charms Collection Elbuntu Guadalinex Guadalinex Edu Kiwi Linux nUbuntu PLD Linux Tilix tuXlab Ubuntu Ubuntu Linaro Evaluation Build Ubuntu RTM Package (Find…) Project (Find…) Status Importance Confirmed Low Assigned to Nobody Me Comment on this change (optional) Email me about changes to this bug report Also affects project (?) Also affects distribution/package Nominate for series Bug Description when connecting to my Ubuntu 12.04 server via ssh I get a log entry Could not load host key: /etc/ssh/ssh_host_ecdsa_key for every (attempted) connection. SSH should be configured in a way that does not generate such a warning... ProblemType: Bug DistroRelease: Ubuntu 12.04 Package: openssh-server 1:5.9p1-5ubuntu1 ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14 Uname: Linux 3.2.0-24-generic x86_64 ApportVersion: 2.0.1-0ubuntu7 Architecture: amd64 Date: Mon May 28 11:00:08 2012 InstallationMedia: SourcePackage: openssh UpgradeStatus: No upgrade log present (probably fresh install) Tags: precise amd64 apport-bug Edit Tag help Michael Nagel (nailor) wrote on 2012-05-28: #1 Dependencies.txt Edit (2.1 KiB, text/plain; charset="utf-8") ProcEnviron.txt Edit (364 bytes, text/plain; charset="utf-8") SSHDConfig.txt Edit (1.5 KiB, text/plain; charset="utf-8") Chuck Short (zulcss) wrote on 2012-05-28: #2 Have you done the following: sudo ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ” Thanks chuck Changed in openssh (Ubuntu): importance: Undecided → Low status: New → Incomp