How to enable root login on ubuntu 16.04 ?

Enable root logins first you have to set a password for the root account and then unlock the locked root account. If you don’t set a password for the root account the passwd command will return

passwd: unlocking the password would result in a passwordless account.  So, first execute in a terminal

you will be prompted for a new Unix password. Write it twice (second for confirmation).

To unlock the account.

passwd: password expiry information changed

Reverting back

If you want to disable root account in Ubuntu you need to lock the root account by using the following command

Alternatives to root login

If you want to work on a root console you can also use