Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#257833 - 07/06/2005 03:02 Hopefully the last linux question for you guuys...
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
(At least for a while )
Sorry for all the questions you guys are the biggest bunch of intelligent people I know of.
Ok I have Ubuntu installed, I have also got apache/mysql/php installed and working. I also have sambs installed and working. currently I have to be root in order to add/del/edit any files i want in the /var/www dir .. How can I (or what is the correct way to) setup /var/www so that "user1" has all the add/del/edit rights and once I can do everything in that dir with that user is there anything i should be careful with when trying to add that dir to my samba config?? Thanks!
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#257834 - 07/06/2005 03:20 Re: Hopefully the last linux question for you guuys... [Re: SonicSnoop]
msaeger
carpal tunnel

Registered: 23/09/2000
Posts: 3608
Loc: Minnetonka, MN
Yeah I want to know how to do that too. I keep having to log in a root.
_________________________

Matt

Top
#257835 - 07/06/2005 04:15 Re: Hopefully the last linux question for you guuys... [Re: SonicSnoop]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
The best way to go about doing what you want is to create a group called "www" or "web", then chgrp the files and directory to be in that group, and change the permissions of the files to be read and writable by the group using chmod. Then later you can add anyone to the www group, and they will be able to modify the web files.

Of course, if you just want the quick and dirty way, a "chown -R username.username /var/www" should do what you want.

Background: Unix files belong to an owner and a group. The files can be specified to be readable, writeable and/or executable for the owner, the group, and everyone else. You can view all this by doing an "ls -l" which will produce output similar to:
-rw-r--r-- 1 root root 364 May 13 2002 index.html
The first character of that colum specifies if it's a directory, the next character if it's readable by the owner, the next if it's writable by the owner, the next if it's executable by the owner. Then it starts over for the group, then it starts over for everyone else.

These permissions are modified by the chmod command, which is usualy used by translating the numeric values to binary and setting those bits, thus "chmod 777 index.html" would change the output to:
-rwxrwxrwx 1 root root 364 May 13 2002 index.html
A simpler way to do this is a+r for "all plus read" and so on. See the man page for more information.

Hopefully that's enough to get you started.

Matthew

Top
#257836 - 07/06/2005 04:19 Re: Hopefully the last linux question for you guuys... [Re: SonicSnoop]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Another thing I forgot to mention is that your web server traditionally runs as "nobody", meaning that the last set of permissions for everyone else needs to include readability if you want the files to be accessible to the web server.

As long as your samba server is doing some authentication before letting people at your web directory you should be all right. It's also always safer to specify which IP addresses can access the samba server in the config file.

Matthew

Top
#257837 - 07/06/2005 14:01 Re: Hopefully the last linux question for you guuys... [Re: SonicSnoop]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Folks are telling you how to "fix" it from the Unix permissions side, but I don't think that's really what you want to do. Take a look at the Users and Security section of the Samba book. I think you're most interested in the "admin users" configuration option.
_________________________
Bitt Faulk

Top
#257838 - 08/06/2005 08:11 Re: Hopefully the last linux question for you guuys... [Re: wfaulk]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Thank you using the admin user part for the samba share worked perfectly for me!
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top