2

When I am in my home folder there is a padlock on my Desktop icon. In properties there is written that root is the owner of Desktop and consequently I can't put anything on my Desktop.

I have recently installed this Ubuntu 14.04 and I would like to know why does the desktop icon belong to root while it wasn't so in Ubuntu 12.04 that I used earlier.

I know how to change the owner of a file using the command "chown" (or maybe this won't work for Desktop?) but I am afraid that it could somehow impair my security so first I would like to know the reason of this default setting.

muru
  • 197,895
  • 55
  • 485
  • 740
geras
  • 476
  • 1
    This is not the default - by default most/all off the user's home directory is owned by that user, so they can use it & have access to it. Have you been running applications as root using sudo? - in that case use gksu or similar, which are designed so as file in the users home directory don't become owned by root. No security risk should be posed if you change the ownership of you user's desktop to your user. – Wilf Jul 25 '14 at 22:26
  • 1
    Yes, it turned out that was the problem - I ran gedit using sudo. – geras Jul 26 '14 at 11:43

1 Answers1

4

To fix it you have to

sudo chown your_user:your_user -R /home/your_user

The change ocured when you ran something, lokely a graphical program as root. Depending on how you called the program, the environmental variables, in this case $HOME were not changed.

In general, use sudo -i or , pksu

See :

https://help.ubuntu.com/community/RootSudo

http://ubuntuforums.org/showpost.php?p=6188826&postcount=4

Why should users never use normal sudo to start graphical applications?

How can I run an application with a GUI as admin from a non-admin user session?

and

Why is gksu no longer installed by default?

Panther
  • 102,067
  • it might of been something like this, butting changing the permissions on the entire home folder has previously led me to be unable to login - just changing the permissions on the affected folders should be enough. – Wilf Jul 25 '14 at 22:24
  • @Wilf Permissions yes, but not ownership . Your problem was likely due to changing permissions of .Xauthority – Panther Jul 26 '14 at 03:44
  • Thanks for your explanation! My problem was probably because I ran sudo gedit ... several times when configuring my system. Fortunately, the command you suggested solved the problem completely. Now I will just have to remember to use gksudo to run graphical programs. – geras Jul 26 '14 at 11:41