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 8.8.8.8" > /etc/resolv.conf; echo "nameserver 8.8.4.4" >> /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 http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add - && sudo wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/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 ntp.ubuntu.com; apt-get -y install ntp; apt-get -y install fail2ban; reboot now;