I do not have access to my root folder: Ubuntu says I do not have the necessary permissions to access it. I also cannot access lost + found
, which gives me the same error message
Is there anyone here that can provide answers to these questions?
I do not have access to my root folder: Ubuntu says I do not have the necessary permissions to access it. I also cannot access lost + found
, which gives me the same error message
Is there anyone here that can provide answers to these questions?
There are two different folders called the "root" folder: /
(the root of the filesystem, which is really the only folder that should ever be called the "root folder"), and /root
(the root user's home directory). During the normal course of operation (i.e., except while performing administrative tasks), users cannot create new files in /
or /root
.
You should not change the ownership or permissions of either directory (changing them for /
in particular could break things very badly, perhaps even beyond creating security problems depending on what assumptions your applications and services make about the ownership and permissions of /
).
If you have the gksu
package installed, you can run gksudo nautilus
to open a root-owned file browser window. If you do this, please be extra careful to only use it for tasks where you must be root, and to close it when you're done (so you don't later confuse it with an ordinary Nautilus window).
If you don't have gksu
installed and don't want to install it, sudo -i nautilus
or sudo -H nautilus
are reasonably safe. (In contrast, if you were to use plain sudo nautilus
, you might have to fix some things in your home directory to get Nautilus to work properly again when you're not running it as root.)
However, usually you don't need to do that either. You rarely have to manually edit the top-level contents of /
or the contents of /root
. I recommend providng more information--or asking a new question--to explain exactly what you're trying to accomplish. The particular task you need to do will determine how you should proceed.
Finally, a note on lost+found
. This stores files recovered in filesystem repair operations. Since such files could be from anywhere in the filesystem, it's necessary to require root permissions to access them (or any information on the system could potentially be accessed by someone who is not an administrator). If you think there may be files there that you wish to reclaim, you can check by running
sudo ls /lost+found
in a Terminal window (Ctrl+Alt+T).
If there are files there that you want, then you can copy them out (and if their ownership and permissions don't give you the necessary access, change them). You can do that as root from the Terminal with cp
, chmod
and chown
(run as root with sudo
), or with a root-owned Nautilus window as described above.
If you need to change ownership and permissions for files, then:
Yes, this is normal to Ubuntu and every Linux distributions. You can't access to the root folder because that folder is owned by root and it's user folder.
But, you can access that folder if you really want by using sudo -i
command in the terminal. Be warned that, if you mess anything, it is your responsibility.
Also using nautilus by Pressing Super+F2 key and typing gksu nautilus
Assuming you want to change the permission of root user's home folder, which is /root
folder, I would say, it is very bad idea to do so. Because, if you change the permission of root's home and you delete or modified some crucial file there, This may result in totally un-usable system. You may need to install Ubuntu from scratch.
But, if you really want it, the command is chmod:
sudo chmod -R 777 /root
will let you gain access to the /root
folder. See the manual page for chmod command here.
To learn more about File permissions, Read this
/root
(a bad idea), they don't have to be 777
. Changing them to 770
and adding select users to the root
group will let those users create, access, and modify files in /root
. Alternatively, changing the group owner of /root
to sudo
will let administrators access it. All of these options are really bad and should not be done, but setting permissions to 777
for /root
is probably the worst of them. I understand your intention in presenting that method is not to advocate it, of course. I'm not disagreeing with you.
– Eliah Kagan
Jul 03 '13 at 17:59
You need to do the following:
Edit /etc/ssh/sshd_config
using sudo nano /etc/ssh/sshd_config
Look for the line that says:
#PermitRootLogin yes
Make sure it looks like the below line:
PermitRootLogin yes
No hashes (i.e., #) and the yes is there.
/
(the root directory) rather than/root
(root's home directory). Furthermore, this also asks aboutlost+found
(which is always in/
but never in/root
, since in practice/root
is one of the few top-level directories nobody puts on a separate filesystem. – Eliah Kagan Jul 03 '13 at 18:27