Dong Nguyen
Alpine

Setup

# login alpine with username `root` and password empty
# then start setting up

setup-alpine

# select keyboard layout: Enter to skip
# choose system hostname: Enter 'alpine'
# configure network interface: skip
# set ip addr: skip
# manual network conf: skip

# changing root password to #n0!
# choose timezone: UTC

# set proxy server: skip
# choose NTP (Network Time Protocol): skip
# specify mirror resource link: `f` for auto detect and apply 
# choose ssh server: openssh

# choose disk to install: enter partition
# choose run mode: `sys`

# DONE
# run `reboot` to restart or
# with virtualbox:
# run `poweroff` to stop
# remove iso image
# change network settings to bridged
# then start again

Run mode:

  • diskless mode: CD, USB

  • data mode: run on CD/USB but write data in hard disk

  • sys mode: install and run totally on drive

First boot:

# install sudo nano vim git wget
apk add sudo

# update sshd config
nano /etc/ssh/sshd_config
# enable some options
# then restart sshd service
/etc/init.d/sshd restart

# add normal user and set password
adduser ndaidong

# add to group `wheel`
addgroup ndaidong wheel

# edit sudoers to enable more permission for `wheel` group
nano /etc/sudoers
################################################
%wheel ALL=(ALL) ALL
%wheel ALL=(ALL) NOPASSWD: ALL
################################################

# remove welcome message from /etc/motd
vim /etc/motd

# add and custom aliases
nano  ~/.ash_aliases

# force Ash load aliases by modifying profile
nano /etc/profile
################################################
# Alias
if [ -f ~/.ash_aliases ]; then
    . ~/.ash_aliases
fi
################################################

Users and groups

# list groups
groups

# list users in group `adm`
groups adm

# add new user
adduser OPTIONS USER GROUP

# set password for current user
passwd

# change password for other user
passwd USER

# add user to group
addgroup USER GROUP

Services

# enable a service
rc-update add SERVICE

# view all service status
rc-status

Package management

apk add PACKAGE
apk del PACKAGE
apk info
apk fix
apk version
apk search
apk upgrade
apk stats

Alpine Linux package management

Desktop

sudo nano /etc/apk/repositories
# add community repo to end of file, save it
# <http://dl-cdn.alpinelinux.org/alpine/edge/community> 

sudo apk update
sudo setup-xorg-base
sudo apk add xfce4 xfce4-terminal
sudo rc-update add dbus
sudo reboot