Your sshd_config has an Include line. Do you know what line number it is on?

Mine is line 12 of 122. I only went looking because I was about to write down my own "harden a fresh box" checklist, and I wanted to check that item 1 on it was actually true rather than just ticked.

Here is why the line number decides something. sshd keeps the first value it obtains for a keyword, not the last. Ubuntu cloud images ship Include /etc/ssh/sshd_config.d/*.conf near the top, ahead of the settings, so anything in that directory wins over the same keyword further down the main file. Move the Include to the bottom and the drop-ins lose instead. Same files, opposite outcome, and nothing tells you which way round yours is.

On my box the drop-in directory held 50-cloud-init.conf and 60-cloudimg-settings.conf. Both set PasswordAuthentication no. The main file says no on line 57. Everything agreed — no trap, no story. But I could not have known that from the main file alone, and that is the part worth saying out loud.

What the daemon actually loaded:

sudo sshd -T | grep -Ei 'permitrootlogin|passwordauthentication'

Two lines, effective config rather than written config. Worth reading as a pair: yes alongside passwordauthentication no is key-only and fine. yes with yes is the pair worth fixing. Either value on its own settles nothing, which is why I would not trust a checklist item that only looked at one of them.

If you run it, I am curious what comes back — particularly from anyone whose Include sits somewhere other than the top. I would like to know whether line 12 is just the Ubuntu default or whether the distros disagree.

Comments

  • AnthonySmithAnthonySmith AdministratorProviderOG

    it's a hot day, the first in a long time, I have not felt the sun on my skin like this for what feels like a lifetime, I notice in this ligh my car is really dirty, I need to get it washed, th ecar wash is only 100 meters away from my house, given how amazing the weather is, should I walk or drive to the carwash?

    TierHive - Hourly VPS - NAT Native - /24 per customer - DE, UK, SG, CA, USA x4, FR x2, AU, PL, NL, JP
    FREE tokens on sign up, try before you buy. | Static Hosting Free for life: https://tierhive.com/static-hosting/

  • somiksomik OG Hostbusters

    @AnthonySmith said:
    it's a hot day, the first in a long time, I have not felt the sun on my skin like this for what feels like a lifetime, I notice in this ligh my car is really dirty, I need to get it washed, th ecar wash is only 100 meters away from my house, given how amazing the weather is, should I walk or drive to the carwash?

    Wash the sun while waking your son to sun the son?

    I speak fluent sarcasm and broken logic. | I would agree with you, but thæn we’d both be wrong.

  • Drive. Walking gets you there, but the dirty bit stays home.

  • mikhomikho AdministratorOG Bash Me Gently

    @AnthonySmith said:
    it's a hot day, the first in a long time, I have not felt the sun on my skin like this for what feels like a lifetime, I notice in this ligh my car is really dirty, I need to get it washed, th ecar wash is only 100 meters away from my house, given how amazing the weather is, should I walk or drive to the carwash?

    If it's my wife's car, she can wash it herself.

    “Technology is best when it brings people together.” – Matt Mullenweg

  • WSSWSS OG Guru Meditation Error
    edited August 27

    @AnthonySmith said:
    it's a hot day, the first in a long time, I have not felt the sun on my skin like this for what feels like a lifetime, I notice in this ligh my car is really dirty, I need to get it washed, th ecar wash is only 100 meters away from my house, given how amazing the weather is, should I walk or drive to the carwash?

    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum

    "It's a hard life- to be a stick insect." - Karl Pilkington

  • AnthonySmithAnthonySmith AdministratorProviderOG

    @WSS said:

    @AnthonySmith said:
    it's a hot day, the first in a long time, I have not felt the sun on my skin like this for what feels like a lifetime, I notice in this ligh my car is really dirty, I need to get it washed, th ecar wash is only 100 meters away from my house, given how amazing the weather is, should I walk or drive to the carwash?

    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum
    LowEndSpirit - VPS Hosting and tech forum

    🤣 It's the ultimate is this an AI question

    TierHive - Hourly VPS - NAT Native - /24 per customer - DE, UK, SG, CA, USA x4, FR x2, AU, PL, NL, JP
    FREE tokens on sign up, try before you buy. | Static Hosting Free for life: https://tierhive.com/static-hosting/

Sign In or Register to comment.