When connecting Raspberry Pi to outside world, you need to think about security. Here are 5 tips that you can use to secure your Raspberry Pi. Let's get started.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Video
5 tips to secure your Raspberry Pi in 3 min video. Take a look.
Step 2: Tip #1. Change Your Password
With standard installation of Raspbian, default username is "pi" and the password is "raspberry". If you haven't at-least changed this password, anyone can log in to your Pi !!.
To change your password go to Menu > Preferences > Raspberry Pi Configuration. In the system tab, click change password, enter one, confirm it and click OK.
Step 3: Tip #2. Keep Raspbian Up to Date
From time to time, security vulnerabilities are found in software, so its always best to get the latest version on regular basis. Open up terminal, and type.
sudo apt-get update
to update your package lists, following that type
sudo apt-get dist-upgrade
to get the latest version of the packages on your Raspberry Pi.
Step 4: Tip #3. Install Fail2ban
If someone wants to hack into your Raspberry Pi, they may try to guess your username and password. It will probably take a lot of attempts, but this is called 'brute-forcing'. To prevent this, you can install a program called Fail2ban. Install it using
sudo apt-get install fail2ban<br>
and a user will be banned for ten minutes if they fail login 5 times.
Step 5: Tip #4. Change Default SSH Port
If you change the default SSH port, anyone trying to connect would need to know which port to use. To alter it open terminal and type,
sudo nano /etc/ssh/sshd_config
and change line #Port 22 to Port 2222 or which ever port number you like. Save and exit. then restart SSH with
sudo service ssh restart
Step 6: Tip #5. Turn Off Interfaces You Don't Need
The safest way to stop hackers is to not have any network connection, but another way of shutting down system a bit more is to go into main Menu > Preferences > Raspberry Pi Configurations and select the interfaces tab. Make sure everything you don't need is disabled.
Step 7: Thats It
That's it Folks. Don't forget to check out my other instructables articles.
***This instructable was inspired by Magpi #80.