1

I am a Ubuntu user, recently I switched from Ubuntu 14.04(Unity one) to Ubuntu 14.04 (GNOME one). I have used Ubuntu 14.04 for around one year and never faced issues in creating, modifying and deleting files in my home folder when logged in as administrator.

Now in GNOME I don't have permissions to delete, open and modify some files. I cannot even move one folder into another. There is an error saying you cannot handle this folder because you don't have permissions to read it.

I followed some links and tried to change permissions by right clicking on the folders but still I don't get permissions. If I perform operations in terminal using 'sudo' there are no problems but why cannot I do things through GUI? How to get these permissions? These problems weren't there in my previous Ubuntu, I was the owner of all the files and folder and could do anything from GUI only.

I am facing one more problem. I am an android studio user and there are some projects in my home folder, some of the project files are shown with a lock icon on them and only root can access them. So, when I run studio it cannot access those files and shows error. Moreover I have installed android studio, made a project and saved it. I created a desktop entry for the studio.sh file so that I don't have to run the studio.sh file from terminal again and again. When I open android studio now whether through terminal or even the launcher I am greeted with fresh setup again. I run the studio.sh file using 'sudo' only. I feel like both the issues are there because I don't have required permissions. Any help is appreciated.

2 Answers2

2

To fix it and conquer back all files in your home directory, run

sudo chown -R $USER: ~

And for the future:

Do not run GUI applications with sudo, but use for example gksu or at least sudo -i or sudo -H to prevent it from taking ownership of files in your home directory.

Byte Commander
  • 110,243
1

Simpliest way:

You need to change the owner of those files:

sudo chown `whoami` path/to/file

Makes your current user (output of the command whoami) to the owner of the files.

sudo chown -cR username:groupname path/to/folder

Makes user username of group groupname owner of folder and all subfolders and files. The name of the group is probably the same as your username. Listing every group a user is in can be done via:

groups username