LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Changing permissions of a folder (https://www.linuxquestions.org/questions/linux-software-2/changing-permissions-of-a-folder-759566/)

knobby67 10-04-2009 05:47 AM

Changing permissions of a folder
 
Hi all,

I've compiled my own code as root (long story why) anyway I now need to switch this to a normal user to compile. So I did a simple copy/paste (using gnome/debian lenny) to my home/user. I then logged in as used to see the folders with a padlock and permissions for root only. So I logged back in as root, change permissions to the used, check they were all ok, logged back in as user, and it still says owner root, even thought when I log in as root it shows user as owner :confused: Can anyone advise. Thanks.

repo 10-04-2009 05:50 AM

try
Code:

chown user:user file
or
Code:

chown -R user:user directory

knobby67 10-04-2009 06:08 AM

Hi I've discovered I have to close my system down to change permission.

However I've found it it changes folders, but not files :s

Is there a way I can change all the files at the same time, when I enter permissions I've clicked sub folders, it's code so there's an awful lot of files folders.

Also on the drop down permissions it has many options, what do I select for all users . Thanks

repo 10-04-2009 06:11 AM

You can use
Code:

chmod -R user:user folder
-R => recursive

See man chmod

You don't need to login logout as root, just login as user, open a terminal and type
Code:

su
password
chmod -R user:user folder


repo 10-04-2009 06:16 AM

Quote:

Hi I've discovered I have to close my system down to change permission.
I don't think you need to do that :-)

Code:

cannabis:/home/repo# mkdir test
cannabis:/home/repo# touch  test/testfile
cannabis:/home/repo# ls -l test
total 0
-rw-r--r-- 1 root root 0 2009-10-04 13:21 testfile
cannabis:/home/repo# chown -R repo:repo test
cannabis:/home/repo# ls -l test
total 0
-rw-r--r-- 1 repo repo 0 2009-10-04 13:21 testfile
cannabis:/home/repo#


knobby67 10-04-2009 08:13 AM

Thanks after some totally locking myself out of folders I got it to work :)


All times are GMT -5. The time now is 12:27 AM.