Generate ED25519 host keys on upgrade

Bug #1300133 reported by Charles Peters II
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Fix Released
Medium
Colin Watson

Bug Description

openssh (1:6.5p1-1) unstable; urgency=medium
  ...
  * Generate ED25519 host keys on fresh installations. Upgraders who wish
    to add such host keys should manually add 'HostKey
    /etc/ssh/ssh_host_ed25519_key' to /etc/ssh/sshd_config and run
    'ssh-keygen -q -f /etc/ssh/ssh_host_ed25519_key -N "" -t ed25519'.
   ...
-- Colin Watson <email address hidden> Mon, 10 Feb 2014 14:58:26 +0000

Most users and many administrators are not going to notice the new host key capabilities when it is buried in a changelog. We should at least give them a obvious hint about it.

Even better would be to prompt the user to generate the keys with a debconf question like was recently done with the "Change to "PermitRootLogin without-password"".

I would like to label this as a security vulnerability, but that may be a bit over the top, it would be a security improvement!

Revision history for this message
Colin Watson (cjwatson) wrote :

I don't think it's possible to write a prompt about this that ordinary mortals will understand, and I'm not sure I'm comfortable with generating new host keys by default. I'd rather just leave this the way it is.

Robie Basak (racb)
Changed in openssh (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Popolon (popolon) wrote :

This key is now generated by default on Finnix that use .deb packages too (see launchpad bug #1314965). this could help as an exemple for adding it.

Revision history for this message
Simon Déziel (sdeziel) wrote :

@cjwatson, IMHO running "ssh-keygen -A" and the accompanying restorecon if applicable should be done unconditionally in postinst.

This way, the admin would be free to simply add the newer HostKey directives they want to use in sshd_config. More details about this suggestion in LP: #1005440 and LP: #1370523

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openssh (Ubuntu):
status: New → Confirmed
Revision history for this message
Charles Peters II (cp) wrote :

# ssh-keygen -A
ssh-keygen: generating new host keys: RSA1 ED25519

I don't think we want to add the old RSA1 keys, just the new ED25519.

Revision history for this message
Simon Déziel (sdeziel) wrote : Re: [Bug 1300133] Re: Generate ED25519 host keys on upgrade

Hi Charles,

On 09/26/2014 01:03 AM, Charles Peters II wrote:
> # ssh-keygen -A
> ssh-keygen: generating new host keys: RSA1 ED25519
>
> I don't think we want to add the old RSA1 keys, just the new ED25519.

The old RSA1 keys won't be used unless you reference it in sshd_config
so there should be no harm.

Simon

Revision history for this message
Josha Foust (josha-foust) wrote :

I think this should be done to improve security, especially in light of the new key rotation feature coming in the next version:

http://blog.djm.net.au/2015/02/key-rotation-in-openssh-68.html

Revision history for this message
Colin Watson (cjwatson) wrote :

openssh 1:7.4p1-5 just landed in zesty. Among the changes, from 1:7.4p1-1:

  * Start handling /etc/ssh/sshd_config using ucf. The immediate motivation
    for this is to deal with deprecations of options related to protocol 1,
    but something like this has been needed for a long time (closes:
    #419574, #848089):
    - sshd_config is now a slightly-patched version of upstream's, and only
      contains non-default settings (closes: #147201).
    - I've included as many historical md5sums of default versions of
      sshd_config as I could reconstruct from version control, but I'm sure
      I've missed some.
    - Explicitly synchronise the debconf database with the current
      configuration file state in openssh-server.config, to ensure that the
      PermitRootLogin setting is properly preserved.
    - UsePrivilegeSeparation now defaults to the stronger "sandbox" rather
      than "yes", per upstream.

Switching to the upstream configuration file has the effect (if sshd_config was previously some stock version, or if the admin accepts the ucf-prompted changes) of commenting out all the HostKey lines, at which point sshd will default to a set including ed25519 and the postinst will generate that host key. I think that addresses this bug as thoroughly as is possible.

Changed in openssh (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.