Best practice is to remove the ability of 'root' to login over ssh. However, I need to run some Ansible commands and am currently connecting via a user called "amdhske" and then have set this user up to not need to enter password to do sudo
otherwise Ansible needs to keep the user's password hanging around.
So what is the point of disabling root access in this case? Any attacker who gets in to the "amdhske" user account over ssh can then sudo
the heck out of the server. I am guessing the only advantage here is that by choosing a lengthy random username makes it highly unlikely an attacker would know about it whereas 'root' is the default username for, well, 'root'. Is there any other reason?
superuser
/sudo
without entering a password. It serves no purpose for your usage case besides disabling another attack vector of course the attack vector that does exist is even worst then root being accessible over ssh.