mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 11:30:55 +00:00
Proper way to add a user.
This commit is contained in:
parent
d1cb7e0b05
commit
bb0c4ec018
1 changed files with 3 additions and 4 deletions
|
|
@ -323,10 +323,9 @@ arch-chroot /mnt /bin/passwd
|
|||
|
||||
# Setting user password.
|
||||
if [ -n "$username" ]; then
|
||||
print "Adding $username with root privilege."
|
||||
useradd -m "$username"
|
||||
usermod -aG wheel "$username"
|
||||
echo "$username ALL=(ALL) ALL" >> /etc/sudoers.d/"$username"
|
||||
print "Adding the user $username to the system with root privilege."
|
||||
arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$username"
|
||||
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /mnt/etc/sudoers
|
||||
print "Setting user password for $username."
|
||||
arch-chroot /mnt /bin/passwd "$username"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue