Update ubuntu.md

This commit is contained in:
EphemeralDev 2025-01-25 21:28:28 -05:00 committed by rbm
parent 318b908637
commit e77743003f

View file

@ -50,7 +50,7 @@ rootless environment for our containers to run in.
## Install ## Install
```bash ```bash
sudo apt install podman sudo apt install podman systemd-container
## Make sure podman is running ## Make sure podman is running
systemctl enable --now podman systemctl enable --now podman
@ -97,6 +97,8 @@ See [jdboyd blog post for PARTIAL examples using UFW, iptables, and nftables](ht
This user will be the owner of all containers with no login shell or root This user will be the owner of all containers with no login shell or root
privileges. privileges.
Container user should have range of uid/gid automatically generated. See [subuid and subgid tutorial](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md#etcsubuid-and-etcsubgid-configuration) to verify range or create if it does not exist.
Note $ctuser is a placeholder, replace with your username Note $ctuser is a placeholder, replace with your username
```bash ```bash
@ -114,8 +116,6 @@ sudo useradd --create-home \
$ctuser $ctuser
# Lock user from password login # Lock user from password login
sudo usermod --lock $ctuser sudo usermod --lock $ctuser
# Add container sub-ids
sudo usermod --add-subuids 200000-299999 --add-subgids 200000-299999 $ctuser
# Start $ctuser session at boot without login # Start $ctuser session at boot without login
loginctl enable-linger $ctuser loginctl enable-linger $ctuser
``` ```
@ -128,9 +128,6 @@ loginctl enable-linger $ctuser
> >
> [reddit post](https://old.reddit.com/r/linuxadmin/comments/rxrczr/in_interesting_tidbit_i_just_learned_about_the/) > [reddit post](https://old.reddit.com/r/linuxadmin/comments/rxrczr/in_interesting_tidbit_i_just_learned_about_the/)
Install systemd-container
`sudo apt install systemd-container`
```bash ```bash
# Switch to $ctuser # Switch to $ctuser
# Note do not remove the trailing @ # Note do not remove the trailing @