Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Part 3 of Arch-Setup.sh Arch Linux Setup Script
- # This script, created by James Triantafylos, will install and configure Arch Linux from start to finish.
- # Instructions:
- # - RUN PART 1 AND 2 OF THIS SCRIPT FIRST
- # - Execute this script with ./Arch-Setup-Part3.sh
- # Requirments:
- # - A wired network connection
- # - A disk over 24GB in size
- # - UEFI boot capability
- # Goto function for BASH
- function goto
- {
- label=$1
- cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
- eval "$cmd"
- exit
- }
- # Create a non-root user
- createUser: 2>&1 >/dev/null
- echo "Enter a username for the non-root user account: (Note: Must be all lowercase!)"
- read NONROOTUSER
- NONROOTUSER=${NONROOTUSER,,}
- echo "Are you sure you would like to create the non-root user $NONROOTUSER? (Y = Yes, N = No)"
- read USERCREATECONFIRMATION
- if [ $USERCREATECONFIRMATION == "Y" ] || [ $USERCREATECONFIRMATION == "y" ]; then
- echo "Creating user $NONROOTUSER..."
- else
- goto createUser
- fi
- useradd -m $NONROOTUSER
- echo ""
- # Set the non-root users password
- echo "Choose your non-root users password:"
- echo ""
- passwd $NONROOTUSER
- echo ""
- # Give the non-root user Sudo capabilities
- echo "Giving the non-root user Sudo capabilities..."
- sed -i -e "\$a$NONROOTUSER ALL=(ALL) NOPASSWD:ALL" /etc/sudoers
- echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement