this post was submitted on 13 Jun 2023
221 points (97.4% liked)

Selfhosted

39251 readers
184 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Is there any benefit to host my own instance?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

that would be perfect.

WIth Debian I would install UFW for a firewall. Set SSH to whatever your home IP is. You can always use the Linode SSH console for external access.

UFW is easy to configure and just translates iptables.

sudo ufw allow from any to any port 80 proto tcp
sudo ufw allow from any to any port 443 proto tcp
sudo ufw allow from HOMEIP to any port 22 tcp

If you want leave SSH open. Then i would probably only do Key based auth in /etc/ssh/sshd_config

you also want to edit that file (sshd_config) to disable root access once setup. I often turn on the following

LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
MaxAuthTries 6
MaxSessions 10
AllowGroups somegroupname

then create a user and a group and add the user to the group. This ensures only that user has SSH access.

sudo adduser someusername
sudo addgroup somegroupname 
sudo usermod -aG somegroupname someusername

You can also use visudo to edit sudoers. The first like will require a password. If you use the second line, you can sudo without a password. I would only do the latter if you only use key-based auth though.


someuser   ALL=(ALL:ALL) ALL
someuser ALL=(ALL) NOPASSWD: ALL

I also edit /etc/hostname to my server name. Update and reboot. From there run through ansible instructions and make edits as necessary.