install docker before new user

This commit is contained in:
2026-07-23 22:50:55 +02:00
parent 8780a57a1e
commit 743654a8d8
+34 -34
View File
@@ -50,40 +50,6 @@ apt install -y \
unzip \
vim
################################################################################
# User
################################################################################
step "Creating administrator"
read -rp "Username: " USERNAME
adduser "$USERNAME"
usermod -aG sudo,docker "$USERNAME"
mkdir -p "/home/$USERNAME/.ssh"
cp /root/.ssh/authorized_keys \
"/home/$USERNAME/.ssh/authorized_keys"
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh"
chmod 700 "/home/$USERNAME/.ssh"
chmod 600 "/home/$USERNAME/.ssh/authorized_keys"
################################################################################
# Repository
################################################################################
step "Cloning configuration repository"
if [ ! -d "$REPO_DIR" ]; then
git clone "$REPO" /home/$USERNAME/$REPO_DIR
fi
cd "/HOME/$USERNAME/$REPO_DIR"
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/"
################################################################################
# Docker
################################################################################
@@ -119,6 +85,40 @@ apt install -y \
systemctl enable --now docker
################################################################################
# User
################################################################################
step "Creating administrator"
read -rp "Username: " USERNAME
adduser "$USERNAME"
usermod -aG sudo,docker "$USERNAME"
mkdir -p "/home/$USERNAME/.ssh"
cp /root/.ssh/authorized_keys \
"/home/$USERNAME/.ssh/authorized_keys"
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh"
chmod 700 "/home/$USERNAME/.ssh"
chmod 600 "/home/$USERNAME/.ssh/authorized_keys"
################################################################################
# Repository
################################################################################
step "Cloning configuration repository"
if [ ! -d "$REPO_DIR" ]; then
git clone "$REPO" /home/$USERNAME/$REPO_DIR
fi
cd "/HOME/$USERNAME/$REPO_DIR"
chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/"
################################################################################
# Security
################################################################################