Create systemd unit to create rke user

This commit is contained in:
Gerald Pinder
2025-05-11 13:22:52 -04:00
parent ad73e87daa
commit f25c8be0f9
4 changed files with 40 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Check if user 'rke' exists
if ! id -u rke &> /dev/null; then
echo "Creating user 'rke'"
# Create user 'rke' with home directory using useradd
sudo useradd --system -m rke
fi
# Add 'rke' to docker group
echo "Adding 'rke' to docker group"
sudo usermod -aG docker rke
echo "Done"
exit 0