Skip to content

Instantly share code, notes, and snippets.

@sbirch
Last active December 16, 2015 08:48
Show Gist options
  • Select an option

  • Save sbirch/5408223 to your computer and use it in GitHub Desktop.

Select an option

Save sbirch/5408223 to your computer and use it in GitHub Desktop.
Quickstart on an Ubuntu image
echo "Making README..."
touch README
wget http://ipecho.net/plain -qO - >> README
echo -e "\n" >> README
echo "Updating packages..."
apt-get update
apt-get upgrade
echo "Installing default packages..."
sudo apt-get install htop
#Not very useful w/ EC2
#echo "Enabling ufw, only port 22/SSH"
#echo "Firewall managed with ufw, currently port 22 open" >> README
#echo "(Don't forget to manage upstream firewalls with your provider)" >> README
#ufw allow 22
#ufw enable
echo "Disabling password login..."
sudo echo "PermitRootLogin no" >> /etc/ssh/sshd_config
sudo echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
service ssh restart
#http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers
#Add logwatch & auto security updates?
echo -e '\a\a\a'
cat /etc/hostname
uptime
echo -e "\nNETWORK:"
sudo netstat -tulpn
echo -e "\nFILESYSTEM:"
df -h
echo -e "\nMEMORY (MB):"
free -tm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment