Technitium DNS server zone high-availability

Installing Alpine Linux on Oracle Cloud

Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resource efficiency.

Alpine Linux is built around musl libc and busybox. This makes it small and very resource efficient. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository.

Binary packages are thinned out and split, giving you even more control over what you install, which in turn keeps your environment as small and efficient as possible.

Follow below step to setup Alpine Linux on Oracle Cloud.

1. Setup a standard Linux cloud instance. I am using Ubuntu 22.04 minimal for this setup.

2. Download virtual version of Alpine Linux ISO on the instance.

wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.3-x86_64.iso 

3. Flash the image to the drive of the cloud instance, e.g /dev/sda. Reboot the server afterward.

sudo dd if=alpine-virt-3.16.3-x86_64.iso of=/dev/sda

4. While the cloud instance is rebooting, access the Oracle Cloud instance via serial console via Cloud Shell.

5. On the serial console, login as root and run below command to prepare for the Alpine Linux installation.

mkdir /media/setup
cp -a /media/sda/* /media/setup
mkdir /lib/setup
cp -a /.modloop/* /lib/setup
/etc/init.d/modloop stop
umount /dev/sda
mv /media/setup/* /media/sda/
mv /lib/setup/* /.modloop/

6. Run below command to start the Alpine Linux installation. Reboot the server once finished the installation process.

setup-alpine

7. To enable ssh passwordless login, login via serial console and insert your own ssh public key.

mkdir ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQIBDKpS9wPxf/7OiToCLPDKy/vWiQU5CjlO3PF51Upo8YhCI77Na8TZgEVrEOVONuTrDO3565oKx05aywaYPlUozD7K9f9CgHXaMpEPAzPSAT9qyZIRZCq/dcAUbbHxIX7dasdadadsezIn44QfX7MepG6rJskcd1duG/UMikwe+4Rxsdsffadadadadad6De6cuPXysxKPP07LvFiAbKwqYFgVYKgbi/kDPb9mRdV/yW+8Nfvsdadada2xO/npDdx7TZwn2egGfbpXZ+dCAodadads6YNsnikLz5kj7AxTkFvDXoj/7mdHe1WwpN ssh-key-2022-01-30" > ~/.ssh/authorized_keys

8. Disable ssh password authentication by replace below 2 settings under /etc/ssh/sshd_config.

#PermitRootLogin prohibit-password
PasswordAuthentication no

9. Restart ssh service with the new setting. 

service sshd restart

10. Access the alpine instance again using the ssh key.

ssh -i oracle-cloud.key root@instance_public_ip


 


Comments