You're viewing a single thread.
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.
53 0 ReplyRegular updates are definitely necessary too. Also, if you do limit SSH users to a chroot make sure you limit TCP (port) forwarding too.
12 0 ReplyContainers can help lock services down if you do it right.
4 0 ReplyYou can have 2FA on ssh?
3 0 ReplyYep. 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.
1 0 ReplySo, 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
1 1 ReplyIt is possible to have 2FA with a security key and ssh. Been on my to do list for some time to try it.
1 0 ReplyYes 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.
1 0 ReplyAh, 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?
1 0 Reply