Right now, I am logged in with my account by default and I want to access some files/folders in my machine. I am unable to access (also no copy/paste) those because I am not logged in as root user. Is there a way to gain root access over those files/folders in Ubuntu? I know i can do su
in command prompt and change the permissions but what is the other way to gain root access?
-
See also Get root access for copying files to /usr/share/…? on Ask Ubuntu, and (not Ubuntu-specific so not everything will apply) How do I run a command as the system administrator (root).– Gilles 'SO- stop being evil'Dec 1, 2010 at 0:35
4 Answers
gksu nautilus
is probably what you want. If you enter it in a terminal or with Alt+F2, it will first ask for your password and then open a folder view of your home directory, from where you can navigate normally. Or you could use
gksu nautilus foldername
to access the folder you want directly. If you are using Kubuntu, replace "nautilus" with "dolphin".
CarlF is on point. sudo
is the command that you want to use to act as a root user.
You must prefix all of your commands with sudo
in order to act as the root
user. Also, in Ubuntu, there is no root user that you can log in as (unless you re-enable it or you su to it from another user), so the computer does not have a root password -- you only have to provide your own password if you exist in the sudoers
file in /etc (I believe) in order to gain root
capabilities.
-
2
Actual there is a root account on ubuntu. Hera step by step tutotial how to get on the root accout.
username@pcname:~$ sudo -i
[sudo] password for username: *****
After this you see something line this below.
root@pcname:~#
!! This enables onlt the root account. It has no password yet. Just typ passwd when you are in root and you can set a new password.
when you want to disable the root account you can just typ
username@pcname:~$ sudo passwd -dl root
More information of this can be found on here (Ubuntu documentation)
Try typing man sudo
.
This will open the manual page for the sudo
command.
sudo
is used to perform a given command with superuser privileges.
-
1why can't i directly access a folder by providing my root password for authentication :(– dsharmaNov 30, 2010 at 19:08
-
1You must prefix all of your commands with sudo in order to act as the root user. Nov 30, 2010 at 19:23
-
1If you want to enter a bunch of commands as root in Ubuntu and don't want to type the bothering sudo everytime, do a "sudo su" to change into superuser. But remember to do an "exit" as soon as you're done doing root stuff...– celebdorNov 30, 2010 at 19:33