Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Best and Easiest way(s) to Secure OpenSSH authentication on your personal systems.

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Best and Easiest way(s) to Secure OpenSSH authentication on your personal systems.


๐Ÿ’ก Newskategorie: Linux Tipps
๐Ÿ”— Quelle: reddit.com

There are two ways that I like nowadays and both of them involve 2FA and hardware keys. Specifically Yubikey in my case, but other ones will probably work as well.

The traditional approach to securing OpenSSH authorization involves several approaches:

  • Traditional SSH Keys - A very good and robust approach for managing access on personal systems. In large organizations the problem of key management is hairier then it seems at first glance.
  • SSH Keys signed with OpenSSH built-in CA support - A intermediate approach that most people are unaware of that are a good match for many businesses and other organizations. With this approach you are using SSH keys that are signed by a CA. This way you can do things like revoke system access quickly in case of a compromise.
  • Kerberos - A great approach if you are using AD or FreeIPA already. But the overhead of managing it is pretty high and relatively minor issues with network configurations can cause massive headaches, which makes it detrimental for personal use.

So for personal use just old fashioned SSH keys are the way to go. However We can make OpenSSH auth even more secure with hardware tokens.

Now the older way to do it is to enable 2FA using OTP (one time password) approach. This generally involves adding additional login requirements in the form of PAM modules. This is going to be the most common search result as it's been in use for years now. It can take advantage of your own TOTP infrastructure or tie into Google's or other providers. This is fine, but I really despise working with PAM. If I can use something OpenSSH supports natively then that is the way to go, IMO. Especially when you can avoid additional infrastructure dependencies.

The two "new" ways I have discovered as of late are:

  1. Take advantage of OpenPGP/Smartcard support available on some hardware cards. Most notable Yubikey 5 series, but there are others. With this approach you use GPG and gpg-agent to manage your private keys. Access is protected by a card PIN (can be up to 127 ascii characters).
  2. Take advantage of FIDO2. Since version 8.2 OpenSSH has supported FIDO2 authentication natively. Which is freaking fantastic. You should use a password encrypted private key for additional security. Make it more 2FA-ish.

Pros of OpenPGP/Smart card approach:

  • Can work with older versions of OpenSSH
  • gpg-agent support is built into proper Linux desktops
  • All the private keys are managed via hardware token.
  • Can use hardware token with a wide variety of other software.
  • More single-sign-on-like You don't have to keep fingering your key for things like ansible.

Cons:

  • A lot of hardware tokens don't have OpenPGP/Smartcard support.
  • Can be a pain to migrate secured (password disable) systems from old key to GPG key. You end up doing things like running one shell with SSH_AUTH_SOCK ssh-agent and another with gpg-agent, or setting up aliases to help copy over new keys and remove old ones.
  • A lot of work is required to setup your card. Need to setup subkeys and such things.
  • You really need to have a second hardware key as backup in case your main key gets lost or damaged.
  • By default gpg deletes private keys from your ~/.gnupg keyring after copying to the card, so you have to back up your keyring prior to that if you want to have backups.
  • Need to configure ssh client to look to gpg-agent instead of ssh-agent.
  • Can't use cool ed25519 keys.

Pros of FIDO2 approach:

  • Minimal additional configuration. Pretty much all you need to do is use ssh-keygen. It's exceptionally easy to setup.
  • ssh-agent is integrated by default in decent Linux desktops.
  • Uses separate encrypted private key (recommended) for additional password protection.
  • easy migration to new keys.
  • Fido2 works well with many websites.

Cons:

  • Can't backup your hardware token. You need a second token if you want backup.
  • If you want backup token you have two sets of keys to manage.
  • Need to finger the device for each SSH usage (can mitigate with OpenSSH ControlMaster feature. May not be true for all hardware tokens.
  • Needs very new (>8.2) version of OpenSSH to work. So no-go on LTS installs like vanilla CentOS 8.

As you can see the Fido2 approach is the slicker and newer of the two approaches. Probably slightly more secure as well.

โ€‹

With the FIDO2 all you have to do is:

  1. Purchase a hardware token that has U2F/FIDO2 support.
  2. Setup the FIDO2 PIN (recommended) (for yubikey use yubiky-manager command "ykman set-pin")
  3. And then run ssh-keygen:

โ€‹

ssh-keygen -C "nice name for key here" -t ed25519-sk -O resident -f ~/.ssh/mynewkey 

And it should prompt you for your fido2 pin and that's it. You can begin copying around the key with ssh-copy-id.

โ€‹

If you do get a hardware token and it does have OpenPGP support then you really are going to want to use it for other stuff. It can tie into Pass password store, secure communication with email and other protocols and a whole bunch of other stuff. If you are already doing that stuff adding OpenSSH support is fairly trivial.

The approach to properly setting up OpenPGP support using GNUPG is significantly more involved. The best guide I know of is this one:

Dr. duh's YubiKey-Guide

He has you go full-paranoid with offline encrypted creation and backup of the keys among other things. Highly recommended. If you are doing it you might as well do it right.

After that you just need to make sure that you have "enable-ssh-support" set in your ~/.gnupg/gpg-agent.conf. (maybe restart your gpg-agent or log out and log back in, whatever works best for you).

And then tell OpenSSH to use the gpg-agent socket. Set the equivalent of

export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) 

If your .bashrc or whatever is appropriate for your setup.

After that you can run:

ssh-add -L 

to list your public key. Which then you can copy around manually. Or just use ssh-copy-id, it'll do the right thing even though there is no pub file in ~/.ssh for it.

โ€‹

After that then pick a standard OpenSSH hardening guide. All the same things apply. Just don't go nuts. No need to make it easy to trivially trigger a denial of service on yourself using silly things like fail2ban. Remember with passwords disabled brute force attacks are worthless. Failed logins are just OpenSSH doing it's job and are about as interesting as logging pings. Successful logins are what you should be monitoring for and be paranoid about!

In /etc/ssh/sshd_config do things like:

PermitRootLogin no PasswordAuthentication no ChallengeResponseAuthentication no 

โ€‹

submitted by /u/natermer
[link] [comments] ...



๐Ÿ“Œ Best and Easiest way(s) to Secure OpenSSH authentication on your personal systems.


๐Ÿ“ˆ 75.8 Punkte

๐Ÿ“Œ Microsoftโ€™s Announces OneDrive Personal Vault to Secure your Personal and Secure Files


๐Ÿ“ˆ 34.7 Punkte

๐Ÿ“Œ Password Manager Pro โ€” Easiest Way to Keep Enterprises Secure


๐Ÿ“ˆ 32.46 Punkte

๐Ÿ“Œ Password Manager Pro โ€” Easiest Way to Keep Enterprises Secure


๐Ÿ“ˆ 32.46 Punkte

๐Ÿ“Œ The Ultimate Security Budget Excel Template โ€“ The Easiest Way to Plan and Monitor Your Security Spending


๐Ÿ“ˆ 31.64 Punkte

๐Ÿ“Œ The easiest way to transfer contacts from your Android to an iPhone


๐Ÿ“ˆ 29.85 Punkte

๐Ÿ“Œ The EASIEST way to Share Your Screen [iPhone, iPad, Mac]


๐Ÿ“ˆ 29.85 Punkte

๐Ÿ“Œ Easiest way to add a video huddle to your application


๐Ÿ“ˆ 29.85 Punkte

๐Ÿ“Œ Dropshare: The Easiest Way to Grab and Share Screenshots


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ Easiest way to build the fastest REST API in C# and .NET 7 using CQRS


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ This is the easiest way to automate existing blinds and it's 20% off


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ The Easiest Way to Bypass Googleโ€™s โ€œBugโ€ and Use New YouTube in Microsoft Edge


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ Security research project: The easiest way to get โ€œexperienceโ€ and land a job in cybersecurity


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ The Easiest and Quickest Way to Generate an OpenAPI Spec for an Existing Website


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ I found the easiest way to automate window blinds, and it's solar powered


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ Configuring Self-Hosted Agent and understanding pipeline styles the easiest way.


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ Browser Hijacking: Signs And The Easiest Way To Remove It


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ XcodesApp 2.0.2 - The easiest way to install and manage multiple versions of Xcode.


๐Ÿ“ˆ 28.14 Punkte

๐Ÿ“Œ Best way to setup OpenSSH server for many users to use only as a SOCKS proxy, with logging of internet data usage and bandwidth.


๐Ÿ“ˆ 26.51 Punkte

๐Ÿ“Œ Want to know the easiest way to save time? Use `make`!


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ Easiest way to get redshift to be time based rather than daylight based?


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ Canonical might have assembled the easiest way to provision a single node Kubernetes cluster


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ [Blog series] One of the easiest way to unpack java malware e.g. Qealler is to use Java agent


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ Easiest Way to Fix High Ping Issue in Gaming in Windows 10


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ The Easiest Way To Install Windows 10 On Ubuntu Linux [How-To]


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ PyWhat โ€“ Easiest Way to Find Out About The Mysterious Text


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ neofetch --ascii_distro gentoo is the easiest way to install Gentoo Linux!


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ Hacker Reveals Easiest Way to Hijack Privileged Windows User Session Without Password


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ As security gets tighter, the easiest way to get malware onto a pc is to trick the person at the keyboard.


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ The Easiest Way to Use Stable Diffusion Right Now


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ Learn the easiest way to uninstall Anaconda on Mac


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ The easiest way to convert RAR to ZIP on Mac


๐Ÿ“ˆ 26.35 Punkte

๐Ÿ“Œ The easiest way to UPSERT with SQLAlchemy


๐Ÿ“ˆ 26.35 Punkte











matomo