There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

pyrosis ,
@pyrosis@lemmy.world avatar

Firewall and deciding on an entry point for system administration is a big consideration.

Generating a strong unique password helps immensely. A password manager can help with this.

If this is hosting services reducing open ports with something like Nginx Proxy Manager or equivalent. Tailscale and equivalent(wire guard, wireguard-easy, headscale, net bird, and net maker) are also options.

Getting https right. It’s not such a big deal if all the services are internal. However, it’s not hard to create an internal certificate authority and create certs for services.

If you have server on a VPS. Firewall is again your primary defense. However, if you expose something like ssh fail2ban can help ban ips that make repeated attempts to login to your system. This isn’t some drop in replacement for proper ssh configuration. You should be using key login and secure your ssh configuration away from password logins.

It also helps if you are using something like a proxy for services to setup a filter list. NPM for example allows you to outright deny connection attempts from specific IP ranges. Or just deny everything and allow specific public IPs.

Also, if you are using something like proxmox. Remember to configure your services for least privileges. Basically the idea being just giving a service what it needs to operate and no more. This can encompass service user/group names for file access ect.

All these steps add up to pretty good security if you constantly assess.

Even basic steps in here like turning on the firewall and only opening ports your services need help immensely.

possiblylinux127 ,

The biggest thing is to change the defaults and to limit access. Unless your are the target of a nation state the attacks against your network will be automated.

foggy ,

Setup Fail2ban

Login only with SSH keys. MFA on SSH login. Use SSH proto 2.

Disable passwords, x11 forwarding, root logins

Reduce Idle timeout interval

Limit users’ SSH access

That should be more than enough for the average use case.

taladar ,

Regular updates are definitely necessary too. Also, if you do limit SSH users to a chroot make sure you limit TCP (port) forwarding too.

possiblylinux127 ,

Containers can help lock services down if you do it right.

MaggiWuerze ,

You can have 2FA on ssh?

foggy ,

Yep. Use SSH keys, not just protocol.

On connection, it’ll ask for your SSH password (this is different from the users password).

After that with something like authelia in place, you’ll be asked for a 2fa code.

MaggiWuerze ,

So, no. SSH can’t do 2FA? I would need to set up Authelia and connect through that? I already use ssh keys instead of passwords to connect to my server

lemmyreader ,

It is possible to have 2FA with a security key and ssh. Been on my to do list for some time to try it.

foggy ,

Yes it can. I literally have it set up right now.

When I connect to my vps I am promoted for the password for my SSH key. Only works on a machine that has the ssh key.

Then I need to use 2fa.

MaggiWuerze ,

Ah, so it the asks for the TOTP provided by Authelia? I misunderstood, sorry. That’s pretty cool. Do you maybe still have the guide you used to set that up?

Deckweiss ,

fail2ban

perishthethought ,

… is an intrusion prevention software framework. Written in the Python programming language, it is designed to prevent brute-force attacks. It is able to run on POSIX systems that have an interface to a packet-control system or firewall installed locally, such as iptables or TCP Wrapper.

catloaf , (edited )

Don’t expose anything to the Internet that you don’t absolutely have to. If you can, put everything behind a VPN gateway.

Make backups. Follow the 3-2-1 rule.

SomeBoyo OP ,

Will a wireguard docker image work for getting ssh access to my server?

taaz ,

I wouldn’t recommend putting ssh behind any vpn connection unles you have a secondary access to the machine (for example virtual tty/terminal from your provider or local network ssh). At best, ssh should be the only publicly accessible service (unless hosting other services that need to be public accessible).

I usually move the ssh port to some higher number just to get rid of the basic scanners/skiddies.

Also disable password login (only keys) and no root login.

And for extra hardening, explicitly allow ssh for only users that need it (in sshd config).

Poutinetown ,

Ssh behind a wire guard VPN server is technically more secure if you don’t have a key-only login, but a pain if the container goes down or if you need to access the server without access to wireguards VPN client on your device.

Lem453 , (edited )

Highly recommend getting a router that can accept wireguard connections. If the router goes down you’re not accessing anything anyways.

Then always put ssh behind the wireguard connections.

For a homelab, there is rarely a need to expose ssh directly so best practice will always be to have multi layered security when possible.

Poutinetown ,

Yeah it’s good to have a system separate from the main server. It’s always so frustrating having to debug wireguard issues cause there’s some problem with docker

Archer ,

Do the secure thing and only access your Linux shell over Discord!

/s

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines