Here's a quick script I run when first setting up an Ubuntu server. Makes it a little easier to use, a little more secure.

  • Use Google's DNS
  • Automatically sync time
  • Install Zip, screen, vnstat, sysstat, s3tools
  • Auto-ban IPs if they try to log in too many times

echo "nameserver" > /etc/resolv.conf; echo "nameserver" >> /etc/resolv.conf; apt-get -y install zip; apt-get -y install screen; apt-get -y install vnstat; apt-get -y install sysstat; wget -O- -q | sudo apt-key add - && sudo wget -O/etc/apt/sources.list.d/s3tools.list && sudo apt-get update && sudo apt-get install s3cmd; sed -i -e 's@Port 22@Port 46279@' /etc/ssh/sshd_config; sed -i -e 's@Port 1157@Port 46279@' /etc/ssh/sshd_config; service ssh reload; cd; /etc/init.d/dns-clean start; ntpdate; apt-get -y install ntp; apt-get -y install fail2ban; reboot now;