You are not logged in.
Pages: 1
hi everyone : D
how do I make a directory (and all the subdirectories) accessible/writable by all users?
thx
Last edited by noname (2008-06-15 14:29:01)
~Seek
Offline
Either you can set:
find /some/dir -type d -print0 | xargs -0 chmod o+rwx
Or just assign the directories to a specific group, put the users in them, and then you're away.
-- Thomas Adam
Last edited by ThomasAdam (2008-06-15 14:09:00)
Offline
Either you can set:
Or just assign the directories to a specific group, put the users in them, and then you're away.
-- Thomas Adam
Very interesting, but how can i do this?
~Seek
Offline
chown user:group directory
or see man chown.
Offline
ThomasAdam wrote:Either you can set:
Or just assign the directories to a specific group, put the users in them, and then you're away.
-- Thomas Adam
Very interesting, but how can i do this?
Well, create a group:
# groupadd mygroup
Then assign your users to that group:
# usermod -aG mygroup someuser
Then set the directory to have the ownership of the group:
# find /some/dir -type d -print0 | xargs -0 chgrp mygroup
Note that you've explicitly stated just the directory and sub-directories which excludes any files therein, of course. You should also ensure that the group permissions on the directories are g+rwx so you allow any members of that group to read and write as appropriate. This approach is slightly better, since you can control which users you allow access to these directories.
-- Thomas Adam
Offline
ok i've understanded, thx alot!
~Seek
Offline
Either you can set:
find /some/dir -type d -print0 | xargs -0 chmod o+rwx
Or just assign the directories to a specific group, put the users in them, and then you're away.
-- Thomas Adam
There is no need to pipe
find /some/dir -type d -exec chmod o+rwx {} \;
Offline
There is no need to pipe
find /some/dir -type d -exec chmod o+rwx {} \;
That can be nasty when the output of find is very large, xargs handles that better by controlling the flow of arguments to chmod. I've read about this on a site once but I've lost that source...
Last edited by Ramses de Norre (2008-06-15 15:34:33)
Offline
Zepp wrote:There is no need to pipe
find /some/dir -type d -exec chmod o+rwx {} \;
That can be nasty when the output of find is very large, xargs handles that better by controlling the flow of arguments to chmod. I've read about this on a site once but I've lost that source...
I have never encountered such a problem so I am not sure what exactly you are referring to . Oh well.
Offline
I have never encountered such a problem so I am not sure what exactly you are referring to . Oh well.
The input buffer is finite -- hence if there's a lot of directories you're working in (and there *could* be) you need to use xargs to make sure that handles things properly.
This was purportedly solved earlier on today.
-- Thomas Adam
Offline
Pages: 1