Skip to content

Instantly share code, notes, and snippets.

@Tantas
Last active September 26, 2016 15:38
Show Gist options
  • Save Tantas/8b9532603fbbcac5d8e0 to your computer and use it in GitHub Desktop.
Save Tantas/8b9532603fbbcac5d8e0 to your computer and use it in GitHub Desktop.
Amazon Linux AMI comfortable environment setup
#!/bin/bash
# Amazon Linux AMI Environment Setup
#===============================================================================
# Connect to the server
#===============================================================================
# Correct the permissions on the SSH RSA key
chmod 600 ./punoff_prod.pem
# Apply a password to the SSH RSA key
ssh-keygen -p -P "" -N "_REDACTED_" -f pem_file_name.pem
# SSH into the provisioned server
ssh ec2-user@ip-address -i pem_file_name.pem
#===============================================================================
# Begin Configuration
#===============================================================================
# Apply updates
sudo yum update
# Install dependencies for the configuring dotfiles and others
sudo yum install -y git rsync tree
# Create the working user
sudo adduser joe
# Set the users password
sudo passwd joe
# Add the user to the wheel group
sudo usermod -a -G wheel joe
# Allow users with the group wheel to sudo
sudo vim /etc/sudoers
# Uncomment %wheel ALL=(ALL) NOPASSWD: ALL
# Switch to the working user
sudo su - joe
# Download and setup dotfiles
git clone https://github.com/Tantas/dotfiles.git
cd ./dotfiles/
chmod +x bootstrap.sh
yes | ./bootstrap.sh
cd ../
# Logout and login again
exit
sudo su - joe
# Create an rsa key for the user and install
# Something like https://gist.github.com/Tantas/d77d67fc21e8a6871885
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment