13 lines
424 B
Bash
13 lines
424 B
Bash
#!/usr/bin/env bash
|
|
set -eux
|
|
|
|
readonly USERNAME="deploy"
|
|
|
|
arch-chroot /mnt useradd --create-home --user-group $USERNAME
|
|
arch-chroot /mnt bash -c "echo $USERNAME:$USERNAME | chpasswd"
|
|
|
|
arch-chroot /mnt mkdir -p /etc/sudoers.d
|
|
arch-chroot /mnt touch /etc/sudoers.d/99_$USERNAME
|
|
arch-chroot /mnt chmod 0440 /etc/sudoers.d/99_$USERNAME
|
|
arch-chroot /mnt echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /mnt/etc/sudoers.d/99_$USERNAME
|