I'm new to linux and the terminal. As I learn how to use the terminal to navigate through directories, I like to use the gui file explorer to mirror my terminal navigation. The icons and file extension info in the gui file explorer help me figure out what everything is. However, I can't access the root folder via the gui, I can only access it via the terminal. Is there a way to enable access to the root folder outside of the terminal?
Ubuntu – root folder access via gui
permissionsroot
Related Solutions
I think what you are looking for is to use nautilus (that's the name of the default file manager in Ubuntu) as a root user. Although it is not advisable (especially for novice users), it is still possible to do it. Open up a terminal (Ctrl+Alt+T) and type
gksudo nautilus
Alternatively, you can type in the following lines in the terminal window
sudo su
nautilus
Enter your password when it asks for it.
This allow you to run Nautilus with root privileges. So you can now freely edit your files using the GUI instead of the terminal. I still don't see the need for it and I cannot emphasize enough on the potential risks involved. Don't blame me if you break your system using this method. You have been warned!
OK, let me write a short clarification. There are two different users: Shannon
and root
. In Ubuntu, by default, root
does not have a password at all and cannot log in at all. If Shannon
wants to do a task requiring root privileges, he uses the command sudo
that consults a file called /etc/sudoers
and has the ability to turn Shannon
into root
.
By default, sudo
wants to make sure that Shannon
actually is Shannon
and not his dog who just took over the keyboard. This is why sudo
asks user Shannon
for his (and not root's) password. Also note that "a task requiring root privileges" can be a bash shell, which essentially means that you can log in as root (without using root password!).
So, it is not that the two users (Shannon
and root
) have different passwords, but that the password of root
is not actually being asked for at all.
Personally, I don't have a dog; that is why I modified /etc/sudoers
in such a way that it never asks me for my password -- being there is sufficient. Using the command sudo visudo
I have edited /etc/sudoers
and edited the following line:
%sudo ALL=(ALL:ALL) ALL
The line above means that all users from the sudo group (and I can only assume that Shannon
belongs to this group if he installed his system) can run essentially ALL root commands.
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
Ah, but now the NOPASSWD directive makes sure that not only I can run any program as root, I can run it without being pestered for typing a password. Note that to edit this file I must use the program visudo
which makes sure that I don't make any syntax error. Syntax error in the sudoers
file might completely disable the sudo system -- and then, if root does not have a password, you are in a deep kacka.
To add confusion, there is yet another program allowing for gaining root privileges temporarily called su
. However, su
is much more primitive -- it just asks for the password of the root. Therefore, it does not work in a default Ubuntu installation.
So, which password is actually asked for when you type sudo su
? Well, the command that you are running first is sudo
, not su
. Thus, you are asked for Shannon
's password, not roots. sudo
then gains root privileges and runs su
as root. But when the root runs su
, su
does not ask for a password. In any case, don't do that -- that is what sudo -i
is for (does exactly the same thing).
Best Answer
Try one of the below commands,
or
It is an GUI way of navigating through directories with root access.