How to chnage owner from rooot

I have got some more partitions other than root and my home directory. When I checked the owner of /home/my_username it was “my_username” but for other partitions where I keep my projects and documents the owner is “root”. I tried changing owner using super user mode in dolphin but it said I do not have permission. Same when I tried changing owner using “chown my_user_name:users /directory” after logging in as super user…

The problem is even after having full permisssion on scripts I have created I am not able to execute them from the directories owned by root.

Is there a way to get this working :o ???

Basically, you cannot and you should not as this is part of the Unix security system. You can run a script that only affects your own files as user.

If you want to run a script that affects system files, you have to run it as root; you don’t need to change the ownership of anything to do that; simply ensure that root runs the script.

N.B. Even then, there are a few things which you won’t be allowed to do for your own safety.

I am not executing scripts effecting system. It is just that I have a partition called “Projects” where I have all the shell scripts or C programs. They are just for learning purpose and I think I should have permission to execute scripts which do not effect anything. I can understand if Unix does not allow me to change system files but not allowing even a script having an echo command is somewhat different. I should access to that :slight_smile:

It sounds to me as if you have been confused by the Windows way of working. In Linux you do not set up separate partitions as if they are disk drives; you add partitions to your system and tell your system about their existence.

Normally, Linux then uses the space as it sees fit. If you want to reserve a partition in the way you might reserve a disk drive in Windows to use with your own files, you have to mount it as a folder within /home. Then it will inherit all the permissions in your /home folder.

I suspect you have mounted it in the normal way causing it to inherit all the permissions of root rather than of /home.

Yes, you are correct. I did that mistake and I now realize that after you said it. Thanks, if i have to reinstall my system in future I will take care of this thing. As of now I got things working, thanks to caf. Changing Owner Of A Drive, Change owner from root to user - Page 2 - openSUSE Forums

Thanks for taking out your precious time to help me out… :slight_smile:

No need to re-install open the yast partitioning tool and change the mount point to something like /home/user/placetobe…