PDA

View Full Version : Re: Command to set folder\file permitions



amo vzug
31-Aug-2011, 09:36
Hi

1) If the user wwwrun has read-rights on this folder, then the
apache2-webserver serves this pages correctly outside. If you need to
provide CGI-scripts, then you must add the executable-right to the
wwwrun-user (or group www).
2) One way is
Code:
--------------------
chown -R wwwrun:www /srv/www/htdocs/*
--------------------
to set the correct ownership and
Code:
--------------------
chmod -R 750 /srv/www/htdocs/*
--------------------
to set the proper rights.
3) It depends, with which user these files are being created. One way
could be to set the umask-flag for this user or the setgid-right on the
directory.

Regards,
Tom


--
amo_vzug
------------------------------------------------------------------------
amo_vzug's Profile: http://forums.novell.com/member.php?userid=25342
View this thread: http://forums.novell.com/showthread.php?t=443903

nanu
31-Aug-2011, 09:56
Thank you!

What will be the influence of the "h" switch in the "chown -hR
wwwrun:www /srv/www/htdocs/*" command?

What is the command to set the setgid-right on the directory.

TIA

Nanu


--
nanu
------------------------------------------------------------------------
nanu's Profile: http://forums.novell.com/member.php?userid=39251
View this thread: http://forums.novell.com/showthread.php?t=443903

amo vzug
31-Aug-2011, 10:16
The "h"-switch changes only the the owner of the symlink itself (it
touches not the ownership of the target-file).

For the setgid-attribut, you need first to change the correct group.
For instance:
Code:
--------------------
chgrp www /srv/www/htdocs/
--------------------

nanu
01-Sep-2011, 08:26
Thanks,

amo_vzug;2133193 Wrote:
> The "h"-switch changes only the the owner of the symlink itself (it
> touches not the ownership of the target-file).
>
> For the setgid-attribut, you need first to change the correct group.
> For instance: >
Code:
--------------------
> > chgrp www /srv/www/htdocs/
--------------------
> > .
> Then you need to modify the rights like this:
> >
Code:
--------------------
> > chmod 2770 /srv/www/htdocs/
--------------------
> >
> /QUOTE]
>
> Is the "2770" in the above code correct?
>
> TIA
>
> Nanu


--
nanu
------------------------------------------------------------------------
nanu's Profile: http://forums.novell.com/member.php?userid=39251
View this thread: http://forums.novell.com/showthread.php?t=443903

amo vzug
01-Sep-2011, 12:16
It depends on, what you're trying. All newly created directories below
htdocs inherits the group, which you set on the htdocs-directory.

The commands

Code:
--------------------

chgrp www /srv/www/htdocs/
chmod 2770 /srv/www/htdocs/

--------------------


are setting the htdocs-directory to


Code:
--------------------

drwxrws--- 2 root www 4.0K Sep 1 13:05 htdocs/

--------------------


Regards
Tom


--
amo_vzug
------------------------------------------------------------------------
amo_vzug's Profile: http://forums.novell.com/member.php?userid=25342
View this thread: http://forums.novell.com/showthread.php?t=443903