brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: sshd -T prints the SSH settings that really apply, a quick security check

Security
~/tips/tip-security-sshd-t-effective-settings

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

Prints the complete effective sshd configuration so you can see what is actually enabled.

The config file only shows what I wrote. The running defaults and includes decide what is really on.

sudo sshd -T | grep -Ei 'permitrootlogin|passwordauthentication|pubkeyauthentication|allowusers'
sudo sshd -T -C user=deploy,host=laptop,addr=192.0.2.10 | grep -i authenticationmethods

sshd -T loads the full configuration, including files pulled in with Include, adds all defaults and prints the result with lowercase keys. That makes it easy to grep for the options that matter.

-C supplies a connection (user, host, addr) so Match blocks are evaluated as well. You need root, because sshd reads the host keys while it does this. Run it after every config change to confirm that a setting really took effect.

Further reading: sshd manual page

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link