You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gennet/alpine_postinst

26 lines
2.0 KiB
Plaintext

#!/bin/echo Run this in VM.
# Add SSH keys
# Change key to your liking
ssh_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQC1vpApfq2RP5Vb832HDZrzkPjF/oVBc4bEq0Nr6vRVIAX07LbgRVtwLKU3m8wB+O8aKKauEGBmDVcNDX9PXyFK6ywemyZ5/jKn6ixe1jq1/60OzclTgXyaaIlfrfUguQvGRZhYKmAbjOKwPLFdN5K7SfzDZ36cw8ojC/uOh3v2keYXnI5j0bd4yJYTa3fpKbb0fZggdBaBfAQTInmavCmTOM+U3Nc/+TAF/oO0PDFvsGO9RSfiCi/wRZiCYR1eAns7zqyItC6j1gMzkBR7c2Xfg5CXMl/lHxOt6y8CS/Ecsc7qEhwpczeRDM4fTgibpHu8VovE61VvSUSwzlekZ1mohlDXsZagLzvG573M+Kql439KcLbd/cZt1peIkk/EyH5KHLZOJvh9ApVaIpdBc3bqXq+JLYvuxaMeEA17Ub4Z92CftkWJPdR/uhn5TxBPtPVjPyaicQqUouItiaxw2WovY+wPTsOn8V3YqE/CtJfipr3eQ8vWNJsK9gUO8Mbtda7I114I35MO/oynvo0hFr4n2GrY8qnbq0Vq7RA5TRrncXWVggvbU/RKJvI8hNw7xghkuiuAZ6H2bklouTdmFMor5y+0rbErUGyyDG2AIywTWWweMiPk5DCcseZT9noK7/2TZjyuqftzdYbQHIHRspZBZ+Sj51g6Fq3nsdaD4BuZZ9ZExGaQSKnzWaUL5Tl1IQ1z6HNtW8dJmRP3qjUE2tSf8d9OFoqIw6k4qPp0K6bzni5I7Ms/sh2AMbkbpEz073NT9u1PaRWiZAiAFXzl8Nl6NF9Vgy8CzEIVG6Ugd1yCejAEIV97PKl7Bg2tRy5FdoKpa2TyTxSqjm5EDBmIi/vTlwVHR74ACE0iESGuZ1UyQI/eQGrGoweAcugoZ00ITy/xgAeNTB9/+14NJMzTUytZpcwqBc0oiT4yv2Z9V6wQDQrswpB0JYX6Epd35BXDdbRTcUGXaCa40LjzMGqVO60U9LG77vr6QQoQ1g0r4Fy1EUiS+YRFu8uNGQfeWDwLw59RLCNaJthirZ6D7ssWLMJ48Ek1BNAwwf0NnGPtgfbecxyADGN4B3smsEnkKhrlMY6lKxGmkrsVf/N9BHBNg/EXPTU69O78PTQ8C9Y/nzfK2wpHn62mzyAIaq3FPLw6WQ8mnXnOGh65LPT3pxCepyr7MKry2qSx+UX6LPrNpKI9vNPIww7gTFD+VTEYIwt5kd3gUS1U5bl2IjHqnTezy7sMVGTseqOg7qs7hICP2hFpNlkR86Ng5hqPaiWIPUgPlnRSdavWffMMI7g1BwK28rY4hTY/QRKz7KJep4zeXick51cHWa89B9CYhVgWODca+GY+nbfPiCmW5riSEW3nm2mV"
mkdir /root/.ssh
chmod 700 /root/.ssh
echo "$ssh_key" >> /root/.ssh/authorized_keys
# Set root password
# Given the use case, we do not care it is in plain text here. Still we enter the
passwd root <<GO
kokoko
kokoko
GO
# Install bird and maybe other tools
apk update
apk add bird
rc-update add bird default
# Run nameif at boot to set network names
# Doc: https://wiki.alpinelinux.org/wiki/Custom_network_interface_names
echo '-SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/sbin/nameif -s' >> /etc/mdev.conf
mkinitfs $(ls /lib/modules)