<img src="//bat.bing.com/action/0?ti=5794969&amp;Ver=2" height="0" width="0" style="display:none; visibility: hidden;">

Running a Root Shell in Ubuntu 13.04

[fa icon="long-arrow-left"] Back to all posts

[fa icon="pencil'] Posted by Dave Lincoln [fa icon="calendar"] September 30, 2013

A little over a year and a half ago, a fellow engineer wrote an article for Enabling the Root Password in Ubuntu 11.10 (instead of using sudo). The article was geared towards providing a convenient way to run root commands in a shell without the need to constantly type “sudo” at the beginning of every command.

Example:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove

Today, I would like to present an alternate method of accomplishing the same task.

At the command prompt type

sudo su

You will be prompted for your sudo password. After entering your sudo password and hitting Enter, you will be dropped into a root shell. The prompt will be similar to this:

root@ubuntu-pc:/home/dave#

Any commands you type moving forward will be done using root privileges (so be careful!). When you are finished, you can simply press CTRL-D or type “exit” and hit Enter. This will drop you back into your regular user shell.

dave@ubuntu-pc:~$ sudo su
[sudo] password for dave:
root@ubuntu-pc:/home/dave# exit
dave@ubuntu-pc:~$

Both methods of running a root shell (this and the previous method) have their advantages and disadvantages. I leave it to the reader to decide works best for them.

Topics: Linux

Dave Lincoln
Written by Dave Lincoln

  • View & Submit Comments

[fa icon="envelope"] Subscribe to Email Updates



[fa icon="comments-o"] Follow us

Get even more great content, photos, event info and industry news.



[fa icon="calendar"] Recent Posts