Bug 20618 - After installing openssh-server host keys are not created automatically
Summary: After installing openssh-server host keys are not created automatically
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-02 11:19 CEST by Alex Kotov
Modified: 2019-04-04 14:50 CEST (History)
2 users (show)

See Also:
Source RPM: openssh-7.5p1-1.mga6
CVE:
Status comment:


Attachments

Description Alex Kotov 2017-04-02 11:19:14 CEST
Description of problem: After installing openssh-server (urpmi openssh-server) host keys are not created automatically. Failed to start OpenSSH server daemon.


Version-Release number of selected component (if applicable): Mageia 6 XFCE Live, openssh-server-7.5.p1-1.mga6


Steps to Reproduce:

1. urpmi openssh-server
2. service sshd restart (or systemctl restart sshd.service)
3. Error:
Job for sshd.service failed because the control process exited with error code.
See "systemctl status sshd.service" and "journalctl -xe" for details.
4. View journalctl -xe:
-- ÐаÑÐ°Ñ Ð¿ÑоÑеÑÑ Ð·Ð°Ð¿ÑÑка ÑниÑа sshd.service.
Ð°Ð¿Ñ 02 12:00:28 gw6.local sshd[2103]: Could not load host key: /etc/ssh/ssh_host_rsa_key
Ð°Ð¿Ñ 02 12:00:28 gw6.local sshd[2103]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Ð°Ð¿Ñ 02 12:00:28 gw6.local sshd[2103]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Ð°Ð¿Ñ 02 12:00:28 gw6.local sshd[2103]: sshd: no hostkeys available -- exiting.
Ð°Ð¿Ñ 02 12:00:28 gw6.local systemd[1]: sshd.service: Main process exited, code=exited, status=1/FAILURE
Ð°Ð¿Ñ 02 12:00:28 gw6.local systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: ÐÑибка ÑниÑа sshd.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- ÐÑоизоÑел Ñбой ÑниÑа sshd.service.
-- 
-- РезÑлÑÑаÑ: failed.
Ð°Ð¿Ñ 02 12:00:28 gw6.local systemd[1]: sshd.service: Unit entered failed state.
Ð°Ð¿Ñ 02 12:00:28 gw6.local systemd[1]: sshd.service: Failed with result 'exit-code'.
Comment 1 Jani Välimaa 2017-04-02 14:29:27 CEST
What if you use start instead of restart?

CC: (none) => jani.valimaa

Comment 2 Alex Kotov 2017-04-02 14:55:03 CEST
(In reply to Jani Välimaa from comment #1)
> What if you use start instead of restart?

The situation is similar. In all previous releases of Mageia (always) the host keys were created automatically, directly on the final stage urpmi openssh-server. In this case only creates the files: /etc/ssh/denyusers /etc/ssh/moduli /etc/ssh/sshd_config. Need to run the daemon sshd host keys are not created. You have to manually run something like: ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N " -t rsa
ssh-keygen-f /etc/ssh/ssh_host_dsa_key -N " -t dsa, and the like.
Comment 3 Jani Välimaa 2017-04-02 16:05:28 CEST
Keys were created properly earlier, but I think last openssh update broke it as some, but not all, changes were synced from Fedora and they changed how keys are generated.

Source RPM: (none) => openssh-7.5p1-1.mga6

Comment 4 Jani Välimaa 2017-04-02 16:26:27 CEST
Key generation is now fixed in openssh-server-7.5p1-2.mga6. It should be available anytime soon in mirrors.
Comment 5 Alex Kotov 2017-04-02 16:50:16 CEST
(In reply to Jani Välimaa from comment #4)
> Key generation is now fixed in openssh-server-7.5p1-2.mga6. It should be
> available anytime soon in mirrors.

Well, let's hope for the best. Thanks for the dialogue.
Comment 6 Jani Välimaa 2017-04-02 18:43:29 CEST
I'm closing this as FIXED. Feel free to reopen if needed.

Resolution: (none) => FIXED
Status: NEW => RESOLVED

conor mcgregor 2019-03-29 06:46:10 CET

CC: (none) => akkaran046


Note You need to log in before you can comment on or make changes to this bug.