fix keep-userns for systemd service generation
All checks were successful
Podman DDNS Image / build-and-push-ddns (push) Successful in 36s
All checks were successful
Podman DDNS Image / build-and-push-ddns (push) Successful in 36s
This commit is contained in:
@@ -16,13 +16,22 @@ Find and replace minecraft with the name of the service.
|
|||||||
### Create the minecraft user
|
### Create the minecraft user
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# As root
|
||||||
useradd minecraft
|
useradd minecraft
|
||||||
|
|
||||||
su - minecraft
|
su - minecraft
|
||||||
|
# Set the minecraft user password
|
||||||
|
passwd
|
||||||
|
# Generate an SSH key for this user. We don't need it now, but it might be handy later.
|
||||||
ssh-keygen
|
ssh-keygen
|
||||||
|
# Exit back to root.
|
||||||
exit
|
exit
|
||||||
|
|
||||||
|
# Optional, copy your authorized_keys into the minecraft user's home dir so you can SSH in.
|
||||||
cp ~/.ssh/authorized_keys /home/minecraft/.ssh/authorized_keys
|
cp ~/.ssh/authorized_keys /home/minecraft/.ssh/authorized_keys
|
||||||
chown minecraft:minecraft /home/minecraft/.ssh/authorized_keys
|
chown minecraft:minecraft /home/minecraft/.ssh/authorized_keys
|
||||||
|
|
||||||
|
# Allow user systemd services to run after you've died (logged out).
|
||||||
loginctl enable-linger $(id -u minecraft)
|
loginctl enable-linger $(id -u minecraft)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -42,6 +51,7 @@ Create a folder called `quadlets` in your podman_minecraft project.
|
|||||||
# Generate the systemd service
|
# Generate the systemd service
|
||||||
podman run \
|
podman run \
|
||||||
--security-opt label=disable \
|
--security-opt label=disable \
|
||||||
|
--userns keep-id \
|
||||||
--rm \
|
--rm \
|
||||||
-v $(pwd)/active/podman_minecraft:/compose \
|
-v $(pwd)/active/podman_minecraft:/compose \
|
||||||
-v $(pwd)/active/podman_minecraft/quadlets:/quadlets \
|
-v $(pwd)/active/podman_minecraft/quadlets:/quadlets \
|
||||||
|
|||||||
Reference in New Issue
Block a user