Live data from Hacker News

How to Secure a Linux Server

github.com

41–50 of 108 posts

Re: How to Secure a Linux Server

#41

> 2FA for ssh Correct me if I'm wrong, but isn't this what password-protected private key encryption is?

No.

Keys are easily (and persistently) added to ssh-agent, at which point it is easy to forward and will generally silently authorize without any further user interaction. That reduces it to a single factor.

Compare that to a totp challenge or a yubi key plus a password. Having one of them won’t get you the other.

Re: How to Secure a Linux Server

#43
post #17

This guide contains (at least) inaccurate statements. It's oversimplifying and omitting important things while putting emphasis on some exotic details where defaults would be sane enough. "One key, the public key, can only encrypt data, not decrypt it" - this is cryptographically inaccurate. One should use it that way, though. "Identity is verified by encrypting and decrypting data that both the client and server kno…

Thank you for the info. Maybe consider improving the GitHub article itself?

I see no point, there are enough guides already and I don't consider myself competent enough in that field to teach others. I think it shouldn't be about fixing every particular mistake in the guide. It's about changing attitude to "I won't write something unless I have a lot of experience". Otherwise it becomes a cat and mouse chase and managing basics for the author.

Re: How to Secure a Linux Server

#44
post #37

Earlier quoted context omitted.

Crikey, look at that mess: Upgrade the version of the browser to an approved version by obtaining software from the vendor or other trusted source. Method 1: View the following registry key: HKLM\Software\Mozilla\Mozilla Firefox\CurrentVersion Method 2: Search for the firefox.exe file using the search feature of the operating system. Examine the files properties for the product version (not the file version. For Wind…

> How about clicking on "About Firefox" in the menu? Perhaps they don’t trust it enough to execute it until they know it’s the latest version and was obtained from a trustworthy source.

At least the version there is baked into the (signed) .exe while the registry information can be edited independently.

Re: How to Secure a Linux Server

#45

> 2FA for ssh Correct me if I'm wrong, but isn't this what password-protected private key encryption is?

The problem with that is that your users can always generate a key without a passphrase at all and you have no way of knowing

Re: How to Secure a Linux Server

#46
post #34
post #17

This guide contains (at least) inaccurate statements. It's oversimplifying and omitting important things while putting emphasis on some exotic details where defaults would be sane enough. "One key, the public key, can only encrypt data, not decrypt it" - this is cryptographically inaccurate. One should use it that way, though. "Identity is verified by encrypting and decrypting data that both the client and server kno…

Fully agree. You missed the most inaccurate one: > Now you need to append the contents of the public key ~/.ssh/id_ed25519.pub to the ~/.ssh/authorized_keys file on the target server. You'll want to do this in a secure way since the public key gives access to your server.

Sorry for being so ignorant but can someone explain why this is so wrong?

Re: How to Secure a Linux Server

#47
post #46
post #34

Earlier quoted context omitted.

Fully agree. You missed the most inaccurate one: > Now you need to append the contents of the public key ~/.ssh/id_ed25519.pub to the ~/.ssh/authorized_keys file on the target server. You'll want to do this in a secure way since the public key gives access to your server.

Sorry for being so ignorant but can someone explain why this is so wrong?

The fact you have the private key permits access, not possession of the public key even though the public key is the one you add to the file on the server side (asymmetric cryptography). The "secure way" may also suggest that you have to keep your public key secret which is not true.

Re: How to Secure a Linux Server

#48
post #12

Earlier quoted context omitted.

You don't have to use a closed source TOTP client such as Google's. There's RedHat's FreeOTP and there's another open source one called antOTP. You can find them on F-Droid as well. There have been TOTP PAM modules for ages (these work on a Linux client and Linux server via e.g. SSH). You can even add YubiKey to PAM. Same for BSD Auth and macOS.

> RedHat's FreeOTP It's abandonware these days and hasn't been updated for years. The iOS app doesn't work anymore and can't use the camera for reading codes.

I use it on ios, and so does most of Red Hat employees (they state it is a preferred version of tfa over the google app.)

It's not broken for the 15 or so accounts I use it for.

Re: How to Secure a Linux Server

#49

> 2FA for ssh Correct me if I'm wrong, but isn't this what password-protected private key encryption is?

You are incorrect. The only factor used there is the key. The password simply decrypts the key to perform the requested authentication.

2FA would be private key (password-protected) and a separate (most likely one time use) password. Something you have (key that you decrypted) and something you know (the one-time password).

Re: How to Secure a Linux Server

#50

It would also be proper to disable non root access to /proc among other things. You can do that by simply mounting with hidepid=2 or adding it to fstab.

Why? Disabling access to /proc will disable a huge number of useful features, such as the ability of a process to monitor and manage its memory usage, to debug itself, and so forth.

For example, /proc/self/pagemap can be used for rowhammer attacks.

Source: Another flip in the wall of rowhammer defenses (IEEE S&P 2018)

Post reply on HN