Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Consistent SSH host key setup when cloud-init / armbian-firstrun are both executed

Featured Replies

Hi,

 

Context

 

systemd's cloud-init.target and armbian-firstrun.service will be started concurrently (both are wanted by multi-user.target). Both will try to create SSH host keys by default:

 - armbian-firstrun will always delete SSH host keys and then generate new ones

 - cloud-init.target (by default) will always delete SSH host keys and then generate new ones.

 

Problem

 

When one must run armbian-firstrun and cloud-init, there is no deterministic ordering between the 2 files execution and therefore no one can guarantee which will be last to setup host keys. In my current scenario, host keys are explicitly setup in cloud-init and I would expect armbian-firstrun to not delete keys + no ssh host key generation.

 

Proposed Solution

 

armbian-firstrun support user defined config to control SSH host keys deletion + generation:

- on: ssh host key deleted + generated (compatibility: current armbian behaviour)

- off: no ssh key deleted + no ssh host key generated. Allow cloud-init to take over this behaviour deterministically.

 

Question

 

I am seeking guidance on where the user config setting should be added. Then I can write the if/else condition in the armbian-firstrun script.

Edited by David A

Solved by Igor

  • Solution

Interesting.

 

Perhaps extending this service?

https://github.com/armbian/build/blob/main/packages/bsp/common/lib/systemd/system/armbian-firstrun.service

At build time, this is cp to the image and enabled:
https://github.com/armbian/build/blob/main/lib/functions/rootfs/distro-agnostic.sh#L400-L401

Script:

https://github.com/armbian/build/blob/main/packages/bsp/common/usr/lib/armbian/armbian-firstrun


All those files you can edit, compile image and try. I hope this helps in some way.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.