Edit the sudoers file with:
sudo visudo
visudo is a command created with the sole purpose of locking the configuration file for sudo command located at /etc/sudoers
Add to the end of the file:
<username> ALL=NOPASSWD: ALL
![Run terminal as root user by default in Ubuntu image 10 - Run terminal as root user by default in Ubuntu](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/12/image-10.png?resize=731%2C481&ssl=1)
Syntax is defined as: username hosts=(users:groups) commands so in our case username ALL= NOPASSWD:ALL means that the user can run any command anywhere without password.
Save the file and exit, the next thing is to edit the shell command.
Navigate to Preferences > Profile > Command and check the “Run a custom command instead of my shell” then as a custom command set sudo gnome-terminal
![Run terminal as root user by default in Ubuntu image 11 - Run terminal as root user by default in Ubuntu](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/12/image-11.png?resize=736%2C360&ssl=1)
That’s it, now every time you open the terminal icon it will start the terminal as root user.