Becoming root on Ubuntu Linux
If you are using Ubuntu Linux you’ve logged in as an user. If you want to become root so you won’t have to input sudo on every command you run, here’s what you need to do:
sudo su -
which is probably what you really want. su – will invoke a login shell after switching the user. Just running su with no parameters will just switch the user (keeping the old shell and environment variables).
You can also run:
Then you get the root prompt and you will be able to run any command as root.