Skip to main content
7 of 8
replaced http://raspberrypi.stackexchange.com/ with https://raspberrypi.stackexchange.com/

Securing a computer is not a simple process, entire books are written on the topic. The Pi's size does not reduce the security threat or attack surface presented to a possible attacker. As a result, I will describe the steps involved and provide links to more detailed instructions and tutorials.

Since you have not mentioned what distro you are using I will assume the recommended Raspbian Distro.

  1. Change the default password. The Raspbian distro includes this as an option in the initial startup script. If you did not do this already you can use the passwd command to change it. Make sure to choose a strong password.
  2. Disable unused services. I saw that the recommended Raspbian distro includes the Apache web server and enables it at startup (can someone confirm this). Do you really need a web server running? If not disable it. If you do need to run Apache be sure to secure it, and do likewise for other service (e.g. FTP, NGINX, MySQL etc.), A google search should turn up several resources.
  3. Install and configure iptables.
  4. Keep your system up to date. You can automate this using cron or using cron-apt.
  5. Configure logging to monitor logins and failed login attempts. If possible use an external Hard drive to host you /var partition, this will give you more space, avoid the log files from filling up the SD Card and extend the life of your SD Card.

Some additional things you may want to consider:

You should also read this related question How can I protect against intrusion and malware before connecting it to the internet (especially on a public IP address)?.

This is only the bare minimum steps for securing your Pi. For more info you may want to read the Securing Debian Manual.

Steve Robillard
  • 34.9k
  • 18
  • 104
  • 109