To disable root login in Ubuntu, you can follow the steps below:
- Open the terminal on your Ubuntu system.
- Type the following command and press enter to open the configuration file for the SSH daemon:sudo nano /etc/ssh/sshd_config
- Scroll down to the line that reads PermitRootLogin yes and change it to PermitRootLogin no.
- Save the changes and exit the editor by pressing Ctrl+X, then Y, and then Enter.
- Restart the SSH service by typing the following command and pressing enter:sudo service ssh restart
Once you have completed these steps, the root user will no longer be able to log in to your Ubuntu system via SSH. It is generally considered best practice to disable root login as it can help to improve the security of your system.