You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# "local" is a default name for storage
pveam update
pveam list local
pveam available
pveam download local alpine-3.17-default_20221129_amd64.tar.xz
pveam list local
# "cephfs0" is the name we have on cehpfs0
pveam update ; \
pveam list cephfs0 ; \
pveam available ; \
pveam download cephfs0 alpine-3.18-default_20230607_amd64.tar.xz ; \
pveam list cephfs0 ;
Copy & Unpack
pushd /var/lib/vz/template/cache/
mkdir ./alpine-3.17-custom/
pushd ./alpine-3.17-custom/
tar xvf ../alpine-3.17-ssh+webi_20221129_amd64.tar.xz
# add keys to root user
vi /etc/init.d/firstboot
# 'no' to 'PasswordAuthentication', 'KbdInteractiveAuthentication'# prohibit-password to 'PermitRootLogin' (or just no?)# AllowTcpForwarding no => yes# GatewayPorts no => yes# Banner ??
vi /etc/ssh/sshd_config
# Welcome to Alpine, BNNA Edition
BNNA's Alpine is slightly different from the stock filesystem.
We've tried to strike a good balance between the minimalism of Alpine,
a few utilities to help you get started here, and an easy way to downsize.
## Table of Contents- Default Shell
- Developer Utilities
- Installed Packages
- SSH Config
- Uinstall it all
## Default Shell`screen` and `fish` are set in `~/.profile`.
-`screen` is the default session manager.
- Next tab: ctrl+a, n
- New tab: ctrl+a, c
-`fish` is the default shell.
- immediate typeahead
- search with up and down arrows
However, it is not POSIX-compatible.
If you need to paste in shell script snippets, drop down to `sh` first.
## Developer Utilities`~/.config/envman/PATH.env` is sourced to set the `PATH`.
It includes the following:
```text~/bin/~/.local/bin/````~/bin` is recommended for your own scripts and programs.
`~/.local/bin` and `~/.local/opt/<program>/bin` will be used
for scripts and programs you install.
### Helpful Commands & Aliases```text# install the latest versions of developer tools, direct from the release api# (bun, caddy, duckdns, flutter, go, gh, hugo, jq, lsd, node, ollama,# powershell, python, rg, rust, sclient, vim-essentials, zig, + many more)webi``````text# add aliasesaliasman# like cat, but with syntax highlightingbat# show the external ip addressmyip# like grep, but respects .gitignore, .ignore, etcrg# creates, enables, and starts an openrc daemon for the given command# ex: serviceman add --name 'my-app' -- node ./server.jsserviceman# show current public keyssh-pubkey# add file or url to ~/.ssh/authorized_keysssh-authorize# allows user programs to listen on privileged ports via libcapsetcap-netbind# to lint shell scriptsshellcheck# to format shell scriptsshfmt# vim-sensible, vim-ale, and other automatic plugins~/.vim/```### Aliases```textcat # bat (cat with syntax highlighting)diffy # diff -y --suppress-common-linesrnd # random stringrnd16 # random hex stringrnd32 # random base32 (Crockford) stringrnd58 # random base58 (cryptocurrency) stringrnd62 # random base62 (GitHub token) stringrnd64 # random (url-safe) base64 stringrnd64rfc # random (rfc) base64 stringts # timestamp as YYYY-MM-DD_hh.mm.ssvi # vim```## Installed Packages
We've added a number of packages that are not included in the Alpine base.
We document those here to prevent any surpises and to make it easier for you
to take control and make it yours.
### System Packages
DO NOT remove unless you know exactly what you're doing - otherwise your
instance may become unrecoverable.
```textsudo # to run any command as rootopenssh # to be able to remote into your instancelogrotate # to prevent running out of storage from logs```### Convenience Packages```textcurl fish git htop less screen vim wget xz unziplibcap # for setcap-netbind```## SSH```text/etc/ssh/sshd_config~/.ssh/authorized_keys~/.ssh/config~/.ssh/config.d/bnna.d/example.sshconfig```### Keys generated on first boot```text~/.ssh/id_ed25519~/.ssh/id_ed25519.pub~/.ssh/id_ecdsa~/.ssh/id_ecdsa.pub```### Key-only login```textPermitRootLogin prohibit-passwordPasswordAuthentication noKbdInteractiveAuthentication no```### Port Forwarding Enabled```textAllowTcpForwarding yesGatewayPorts yes```## Uninstall it all
To uninstall the non-stock files and programs which are not necessary to use the instance:
```sh
rm -f ~/.profile ~/.bashrc ~/.npmrc
rm -rf ~/.config/envman ~/.config/fish
rm -rf ~/bin ~/.local/bin ~/.local/opt
sudo --no-cache apk del curl fish git htop less screen vim wget xz unzip
rm -f ~/README.md
```
This will keep:
-`openssh` - needed to access the instance
-`sudo` and `libcap` - needed if you keep access to a user account
-`logrotate` - needed if your services have logs
To remove the 'app' user and only run as `root`, see the SSH configuration above, and then remove the following:
```sh
sudo cp -RPp ~/.ssh /root/
sudo chown -R root:root /root/
rm /etc/sudoers.d/app
deluser --remove-home app
delgroup app
```
The text was updated successfully, but these errors were encountered:
coolaj86
changed the title
document custom image
Document how to customize LXC fs
Mar 21, 2023
This now has its own repo: https://github.com/bnnanet/bnna-customizers.
Todo:
less
bat
ssh-adduser
Download Alpine Container
Copy & Unpack
Mount
/dev
& ChrootModify
~/.config/envman/alias.env
:Unchroot & Unmount
Cleanup
firstboot
script~/README.md
The text was updated successfully, but these errors were encountered: