The objective is to access root shell and optionally change the default root blank password on Ubuntu 18.04 Bionic Beaver Linux.
Operating System and Software Versions
- Operating System: – Ubuntu 18.04 Bionic Beaver Linux
Privileged access to your Ubuntu System as root or via
sudo command is required.
- # – requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ – requires given linux commands to be executed as a regular non-privileged user
Other Versions of this Tutorial
There is no default root password on Ubuntu 18.04 Linux. However, if you need to execute a command with root privileges you can prefix your command with
The below example will execute the
whoami command as a root user. Replace the below
whoami command with the command you wish to execute as root:
$ sudo whoami
If you do not wish to use the
sudo command every time you need to execute a command with root privileges you can gain the root shell by using the
sudo command and its
$ sudo -i #
Please note that your command prompt will change from
# which indicates that you are currently logged in as root.
If you wish to change the default blank root password and set root password enter:
$ sudo passwd
Once the root password is set, you can login as root by using the