1. To set a root password open up a terminal window and execute the following sudo command. First, you need to enter your user password ( given that you are part of the sudo administration group ) after which enter and retype a new root password :
    $ sudo passwd
    [sudo] password for linuxconfig: 
    New password: 
    Retype new password: 
    passwd: password updated successfully
    
  2. All done, you should now be ready to log in with a new root password. Try it now:
    $ su
    password:
    
  3. Use the whoami command to confirm that you are logged in as a root user:
    # whoami
    root
Was this answer helpful? 0 Users Found This Useful (0 Votes)