Code Blog

Displaying 1-1 of 1 result.
2017/04/13 Hosting,Network,Linux

Set hostname and timezone

Setting the hostname in Debian 8 / Ubuntu 15.04 and later

hostnamectl set-hostname hostname

Update /etc/hosts localhost.localdomain localhost hostname

Set the timezone
dpkg-reconfigure tzdata

Security settings

Linode has a good guide on increasing security for the linux installation, see

Topics covered:

  • Enable automatic security updates
  • Create a limited user account
  • Only use 4096-bit RSA key-pair for SSH login (don't accept passwords)
  • Disable root login over SSH (run sudo on limited user instead)
  • Turn off IPv6 if not needed
  • Set up Fail2ban (block IP after multiple failed login attempts)
  • Remove unnecessary packages (i.e. EXIM and RPC) to reduce number of open ports
  • Set up a firewall (IPTABLES or i.e. UFW for Debian/Ubuntu)

The article also has links for more security features such as intrusion detection.

URL rewrite

In /etc/apache2/apache2.conf add a <Directory> block and add "AllowOverride All". Then also run "sudo a2enmod rewrite" and restart Apache with "sudo service apache2 restart".