bootstrap.sh aktualisiert

Change to userinput
This commit is contained in:
kevinheyer 2025-06-12 19:29:44 +00:00
parent dc17562c0a
commit 029706d7c6

View file

@ -7,8 +7,15 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
# Use the current user
USERNAME=$(whoami)
# Prompt for username input
read -p "Bitte geben Sie den Benutzernamen ein: " USERNAME
# Check if the username is not empty
if [ -z "$USERNAME" ]; then
echo "[✗] Kein Benutzername eingegeben." >&2
exit 1
fi
SSH_KEY_URL="https://skulldev.de/Skull-IT/trusted-ssh-keys/raw/branch/main/trusted-ssh-keys"
SSH_DIR="/home/$USERNAME/.ssh"
@ -32,7 +39,7 @@ usermod -aG sudo "$USERNAME"
# Configuring passwordless sudo for the user
echo "[+] Configuring passwordless sudo for $USERNAME..."
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/$USERNAME"
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" | tee "/etc/sudoers.d/$USERNAME" > /dev/null
chmod 440 "/etc/sudoers.d/$USERNAME"
# Setting timezone