Please refer to the following article to disable root login using SSH in Linux.
- Login to your Linux server via console or sudo user.
- Open the sshd_config file from the location /etc/ssh/ using your favorite browser.
- Change the Permit root login to sshd_config and save the file.
→ Looking to change SSH port on ubuntu? Please refer to the change ssh port on ubuntu for more details.