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

regenerate ssh keys at first start up #139

Closed
rschitz opened this issue Jul 9, 2018 · 2 comments
Closed

regenerate ssh keys at first start up #139

rschitz opened this issue Jul 9, 2018 · 2 comments

Comments

@rschitz
Copy link
Member

rschitz commented Jul 9, 2018

it would be a thing to regenerate ssh keys for security reasons at first boot of a freshly deployed appliance

@rschitz
Copy link
Member Author

rschitz commented Jul 9, 2018

rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
systemctl restart ssh

@rschitz rschitz added this to the 0.99f - Ravenholm milestone Jul 10, 2018
@rschitz rschitz added wontfix and removed wontfix labels Jul 28, 2018
@tsborland
Copy link

Could easily create an init script, and disable it once the first boot has concluded.

Create file /etc/init.d/99-sexigraf-firstboot.sh:

#!/bin/bash

/bin/rm /etc/ssh/ssh_host_*

/usr/sbin/dpkg-reconfigure

/bin/systemctl restart ssh

/usr/sbin/update-rc.d 99-sexigraf-firstboot.sh disable

Make sure the ownership is correct:
chmod 755 /etc/init.d/99-sexigraf-firstboot.sh

Enable the script prior to packaging OVF:
update-rc.d 99-sexigraf-firstboot.sh defaults

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

2 participants