bootstrap.sh aktualisiert
Change to userinput
This commit is contained in:
parent
dc17562c0a
commit
029706d7c6
1 changed files with 10 additions and 3 deletions
13
bootstrap.sh
13
bootstrap.sh
|
@ -7,8 +7,15 @@ if [ "$(id -u)" -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use the current user
|
# Prompt for username input
|
||||||
USERNAME=$(whoami)
|
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_KEY_URL="https://skulldev.de/Skull-IT/trusted-ssh-keys/raw/branch/main/trusted-ssh-keys"
|
||||||
SSH_DIR="/home/$USERNAME/.ssh"
|
SSH_DIR="/home/$USERNAME/.ssh"
|
||||||
|
|
||||||
|
@ -32,7 +39,7 @@ usermod -aG sudo "$USERNAME"
|
||||||
|
|
||||||
# Configuring passwordless sudo for the user
|
# Configuring passwordless sudo for the user
|
||||||
echo "[+] Configuring passwordless sudo for $USERNAME..."
|
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"
|
chmod 440 "/etc/sudoers.d/$USERNAME"
|
||||||
|
|
||||||
# Setting timezone
|
# Setting timezone
|
||||||
|
|
Loading…
Add table
Reference in a new issue