DO Ideas 2

Disable access to server without SSH keys

Maybe I'm missing something, but it seems that I can access my server through SSH without a key (it still prompts for user/pw if you don't supply the key)? I destroyed the server I originally had that didn't have ssh keys associated, then built a new one, and selected my keys, but can still ssh into it without a key. Is this normal?

  • James W.
  • Sep 11 2018
  • Shipped
  • Attach files
  • James W. commented
    September 11, 2018 19:08

    I also found that you can do "PasswordAuthentication" to no to not allow any logins without the ssh key. Thanks!

  • James W. commented
    September 11, 2018 19:08

    I knew it was something stupid. Didn't realize this was on by default. Thank you!

  • Moisey Uretsky commented
    September 11, 2018 19:08

    You would need to update your sshd_config to disable:

    PermitRootLogin no