this post was submitted on 29 Jul 2025
7 points (88.9% liked)

Linux

12269 readers
13 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

https://blog.thc.org/infecting-ssh-public-keys-with-backdoors

I am not a security expert and I wonder:

  1. Does the described method infect the remote or local machine (from which I connect)?
  2. Can this method be prevented? For example, correctly configuring your etc/ssh/ssh_config

It seems that every VPS supplier can hack you? The description shows that AWS does "harmless", but what if my hosting is a bad actor?

top 4 comments
sorted by: hot top controversial new old
[–] Shadow@lemmy.ca 13 points 2 days ago* (last edited 2 days ago) (1 children)

If your hosting is a bad actor, you're screwed no matter what. Why bother with this when they have direct access to your disk and ram

You could turn off authorized key files, or lock them down. This isn't really a big security risk though, there's countless ways to backdoor a system once you have access to do this.

This just targets a remote account, not your local pc.

[–] IronJumbo@lemmy.world 1 points 1 day ago (1 children)

In that case, it seems to me that the only threat is the mindless copying of public keys to other servers, as described in the article. But who does so? Do admins not create separate private-public keys for each server?

Thank you for the explanation!

[–] Shadow@lemmy.ca 1 points 1 day ago* (last edited 1 day ago)

Most don't create new keys per server machine but that's not the issue. I don't bother, I create a key per client machine on my side.

Server gets compromised once, admin logs in and fixes it, admin logs in next time and the backdoor compromises it again.

That's all this is. If you can get in once, it's a spot you can leave a backdoor that many admins will miss. That's it.

Admins don't generally copy that whole file around, they usually copy and paste the lines they want. Also I generally copy and paste it from my workstation, not another server.

[–] treadful@lemmy.zip 5 points 2 days ago

OpenSSH has an unsung feature to execute a command (instead of a Shell) when a user successfully logs in.

It's remote.

Also, it's not really that exciting. They already would need access to your account. It would be very obvious when copying it as well.