Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need PERMISSION! 1

Status
Not open for further replies.

rjja

Technical User
Jul 9, 2002
11
US
I have set up my normal username up as a "superuser" with all grants and priveleges, placed "apache" in my supplemental groups, placed myself in apache's supplemental groups, and STILL cannot:

a) read or write to the apache document root: /var/
b) open the httpd.conf file.

I used "Userconf" in my Mandrake dist to make the alterations.

I have logged out and rebooted after making user chages, to no avail.

If I log in as root I have no problems.

Any ideas?

Thanks,
Rich
 
do an ls -l of the files you're trying to view/edit. Look for the permissions bitset. It'll look something like this:

rwxrwxrwx
rw-r--r--

This is three octets of permission. First is owner, second group, third all. r=read, w=write, x=execute.

My guess is that the files you're trying to read only allow access to owner (rwx------ or rw-------). Your username is probably not the owner, so you can't do anything to them.

As root, permissions don't matter, you can do whatever you want. There isn't a way to make your user a "superuser" like root. It's root and that's it.
 
for httpd.conf (which I can't change): -rw-r--r--

for the var/ (which I can't copy to or from): drwxr-xr-x

for var/ -rw-r--r--

How do I determine who owns it?

What utility do I use to change owners if that is necessary or the way to approach this?

How do people normally publish sites if they don't own the files?

Rich
 
The owner/group will be the next set after the permissions.

Example:

drwxr-xr-x 28 bin bin 512 Sep 26 13:09 usr

bin owns this directory and bin is the group.

Usually for publishing, you either make the owner of the content the owner of the file, or part of the group that owns the file.

Looking at your files:

httpd.conf, you should be able to view, but not change this file.
/var/ you should be able to see everything in it, but not add or delete
file in html, you should be able to view but not change.

To change permissions, use chmod. The syntax is:

chmod <change> <dir or filename>

for <change>, use u for user, g for group, a for all, + for add, - for remove, r for read, w for write, x for execute.

So, to add group write to httpd.conf, do:

chmod g+w httpd.conf
 
Oh yeah. To change owners:

chown <newowner> filename

To change group:

chgrp <newgrp> filename

Must be the current owner or root to do either.

If you use -R with chown, chgrp, or chmod, it will make the change recursively (i.e. chmod -R g+w /var/ would add group write to the directory html, and all files and directories under it). Be *careful* with -R, make sure it's what you really want to do before doing it :)
 
Also, chown user:user will change owner and group with one command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top