Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect sshd host keys #66

Open
wommel opened this issue Apr 22, 2020 · 2 comments
Open

protect sshd host keys #66

wommel opened this issue Apr 22, 2020 · 2 comments

Comments

@wommel
Copy link

wommel commented Apr 22, 2020

The main systems ssh keys should not be exposed (thats the whole point in encrypting the root partition). A way to acomplish this should at least be documented. Maybe it should even be the default beahviour.

To currently do this you need to:

  • uninstall tinyssh-convert if already installed
  • remove /etc/tinyssh/sshkeydir/ if already existing
  • run tinysshd-makekey /etc/tinyssh/sshkeydir/ to generate unique keys
  • change tinysshd ssh port so ssh doesn't complain about changed host key. so create /etc/systemd/system/initrd-tinysshd.service.d/override.conf
    containing:
[Service]
Environment=SSHD_PORT=1234
  • regenerate init image, mkinitcpio will complain about tinyssh-convert not exsiting but thats exacly what we want here
  • to unlock now remeber to use the changed port ssh -p 1234 root@server

The error message when generating the image should be removed or at least changed to a warning.

I think the most elegant solution would be to put the conversion into a seperate service and maybe provide a file in config for the port.

@Andrei-Pozolotin
Copy link
Collaborator

Andrei-Pozolotin commented Apr 22, 2020

  1. thank you for the idea

  2. you are welcome to send a PR for a new unit,
    to be named, say initrd-tinysshd-secure.service,
    which can rely on new support functions (keys re-gen, key cleanup, etc)
    to be stored initrd-build.sh

@Andrei-Pozolotin Andrei-Pozolotin changed the title Don't expose openssh host keys protect sshd host keys Apr 30, 2020
@ArchangeGabriel
Copy link
Contributor

I think that the conversion should not be done automatically at all. This should be an user choice from the start, and also there is no point in running the conversion at each initramfs generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants