Consideration to create post/article for SSH - PermitRootLogin - forced-commands-only

Hello ItsFoss

Just being curious if you would consider in write a post/article about SSH
covering the PermitRootLogin keyword mentioned at noble (5) sshd_config.5.gz. Mostly for the forced-commands-only argument. But a complete covering for each argument would do the tutorial more valuable.

Why I am requesting this? due the following content

If this option is set to forced-commands-only, root login with public key
authentication will be allowed, but only if the command option has been
specified (which may be useful for taking remote backups even if root
login is normally not allowed). All other authentication methods are
disabled for root.

So this argument is very important to do remote backups through SSH

Thank for your understanding

I use SSH with public key authentication and root login not permitted. I use ‘sudo’ when root authority is required. This has been sufficient for my needs.

1 Like

Thanks for the reply

Interesting your approach - but I want to know with a real sample through the requested tutorial how the forced-commands-only works. It to have a clear idea about how works exactly and when is mandatory use it.

Now, would be very nice add your approach and do a comparison between them in the requested tutorial.