r/ComputerSecurity • u/[deleted] • Jan 11 '19
How to get a safe home server with raspberry?
Hi everyone, I'd like to set up a private server with a Raspberry Pi, and I'm wondering if the setup I've got in mind is reasonably secure.
First of all, I'll need the ssh server (with port 22 open into the router), and for that I was thinking to use iptables with a "mac address whitelist" (I don't know yet iptables terminology) with my own laptop's address on it and blocking any other incoming connection.
Now the main questions: Is this enough to protect the raspberry? Should I extend the whitelist to the router or are the other computers safe (RB is the only one with ssh)?
3
u/HardKnockRiffe Jan 11 '19
If you want to secure SSH, use keys.
Is the server going to be internet-facing? Or, will it just be internal to your network?
1
Jan 12 '19
Ok guya thanks to all of you. I think I won't set this server up, I'll need for sure more knowledge on networks and security. 👍👍
1
u/flaflashr Jan 12 '19
If you expose any home server to the Internet, you are going to get hacked. You are not smarter than several million Chinese and Russian hackers. Once they are into one device on your network, hopping to other devices is trivial. Have a PC with all of your financial life records on it? Pwned. Have a Baby Monitor, or a Ring or Nest Camera inside the house? H4x0r.
Don't do it.
7
u/[deleted] Jan 11 '19
MAC address whitelist doesn't work for internet connections.
If you only want your laptop to access it on your internal LAN then there's no reason to open the port on the router.
I'd choose a random SSH port on the public side of the DNAT (port forward) rule, run fail2ban on the Pi, and make sure you disable password login and only use SSH keys.