Jump to content

Customizing image with ssh key and static ip to be installed on multiple boards


Go to solution Solved by Oscar Linderoth,

Recommended Posts

Posted

Hello, 

 

I am planning to create a Kubernetes cluster from 5 Raspberry PI and one of the alternatives mentioned in tags, 9 hosts in total. 

I want to mount and customize the installation images with ssh keys, static IP address, etc, and to skip the initial script offered at login by the CLI images.

Can you point me to the right piece of documentation? 

 

Thank you, 

 

Stefanita Vilcu

 

  • Solution
Posted

Hi Stefanita,

 

I wanted to do something similar with a few HC4's (also to run Kubernetes, incidentally :) ). I settled on this:

 

- Install authorized_keys in the image using customize-image.sh - https://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-image-customization-script

- SSH to each sbc after first boot, enter a root password and then cancel the rest of the setup script. It looked to me like the script does some important things before that point.

- Configure the rest with Ansible.

 

 

If you found a better way to boot non-interactively I'd be happy to hear!

 

Best regards,

Oscar

 

 

--- userpatches/customize-image.sh.default      2024-04-30 08:20:03.777276669 +0200
+++ userpatches/customize-image.sh      2024-01-28 23:46:07.822794026 +0100
@@ -36,6 +36,12 @@
                        # your code here
                        ;;
        esac
+
+       # install ssh keys
+       mkdir /root/.ssh
+       chmod 700 /root/.ssh
+       cat /tmp/overlay/id_ed25519.pub >> /root/.ssh/authorized_keys
+       chmod 600 /root/.ssh/authorized_keys
 } # Main
 
 InstallOpenMediaVault() {

 

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines