Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
4  
@DevynCollierJohnson Probably not. It seems likely that this is asking about / (the root directory) rather than /root (root's home directory). Furthermore, this also asks about lost+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 3 '13 at 18:27
add comment

2 Answers

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:

  1. make sure not to do so for more files than necessary--for example, some people accidentally change ownership or permissions for large parts of the system and then have to reinstall, and
  2. I recommend this guide for understanding the ownership/permissions system in Ubuntu (which also applies to most other Unix-like OSes). Wikipedia may help too.
share|improve this answer
add comment

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

Changing permissions of root folder.

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

share|improve this answer
    
Ok Thanks, but how can I change permissions so I can have access to those folders, what commands do I need or can you please provide a link for listed commands, I'm new to ubuntu. Thanks –  zanxt Sep 15 '12 at 7:03
    
@zanxt see my updated answer –  Anwar Shah Sep 15 '12 at 7:37
2  
Be aware that the security of Linux and Ubuntu relies on such things as not being logged in as root, and maintaining the permissions on system and root files as they have been set up. There's really very little reason why you would need to get access to the root folder in normal use. It is only there to provide compatibility with those processes that do need to be root. –  fabricator4 Sep 15 '12 at 8:12
    
Even once someone has decided to change permissions on /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 3 '13 at 17:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.