Background: 15 years of experience in software and apparently spoiled because it was already set up correctly.

Been practicing doing my own servers, published a test site and 24 hours later, root was compromised.

Rolled back to the backup before I made it public and now I have a security checklist.

you are viewing a single comment's thread
view the rest of the comments
[–] 43 points 2 years ago (3 children)

Do not allow username/password login for ssh. Force certificate authentication only!

  • source
  • hideshow 6 child comments
  • [–] 12 points 2 years ago (1 child)

    If it's public facing, how about dont turn on ssh to the public, open it to select ips or ranges. Use a non standard port, use a cert or even a radius with TOTP like privacyIdea. How about a port knocker to open the non standard port as well. Autoban to lock out source ips.

    That's just off the top of my head.

    There's a lot you can do to harden a host.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 years ago

    Do not allow username/password login for ssh

    This is disabled by default for the root user.

    $ man sshd_config
    
    ...
           PermitRootLogin
                   Specifies whether root  can  log  in  using  ssh(1).   The  argument  must  be  yes,  prohibit-password,
                   forced-commands-only, or no.  The default is prohibit-password.
    ...
    
    
  • source
  • parent