Member-only story

Securing Home Server Based on Raspberry Pi against Dark Hacks

Maciej
5 min readNov 2, 2020

--

Introduction

In this article, I will show you how to defend against dark hacks, but what exactly you can do in this article ??

  • SSH connection
  • Connection using public / private key
  • Firewall settings
  • Dos attack, brute force attack countermeasures
  • Use free DNS
  • Accessing Raspberry Pi in your house from an external network, etc.

Let’s get started

Add new users to Raspberry Pi

In the default state, the pi user exists, and if it is left as it is, it may be invaded by the Raspberry server by targeting the pi user, so add another new user and delete the pi user. It also grants sudo privileges to the newly added user.

$ sudo adduser [username]
$ sudo usermod -G sudo [username]
$ sudo userdel -r pi

✏️ By adding -r to userdel, the home directory /home will also be deleted.

Enable SSH connection

$ sudo raspi-configOpen the setting screen with, select Interfacing Options-> P2

--

--

Maciej
Maciej

Written by Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

No responses yet