LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-07-2003, 09:19 PM   #1
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Question Is it possible to allow regular users to work on a web page but not anything else?


Is it possible to allow regular users to work on a web page but not anything else? For example, the web page is kept in the www directory. There are also other files in that directory. I do not want the user to be able to access anything else in the diretory. The page is a community page that I want to allow reglar users work on, but I do not want to compromise the box or other pages. It is important the user be able to see the page on the web server to see how it "fits". Any ideas?

Additionally, if I made a group and put users allowed to work on the page into the group, can I make all users in the group have to have the same password to login without actually affecting their passwords. For example, to access the page, people in the group would have to enter another common password upon trying to access the file. Not sure if this is possible.

Thanks
 
Old 11-07-2003, 10:47 PM   #2
scott_R
Member
 
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 748

Rep: Reputation: 31
What you do is make a group that's only for that file/directory (depending on your needs), then add that group to the user's list of groups they are members of. For instance, make a 'webpage' group, make that file owned by the webpage group (chown), then make those users who need to access the file members of that group. When they log into their normal accounts, they'll automatically log into their ability to edit that page, but you'll also be able to track (log) who changed what when, if you desire.

As far as seeing how it "fits" into the directory structure (I'm assuming), you can edit the group permissions to allow them to read the directory, but only edit that one (or group of) files.
 
Old 11-08-2003, 12:50 PM   #3
saint
Member
 
Registered: Sep 2001
Location: India
Distribution: Red Hat 9
Posts: 55

Rep: Reputation: 15
Quote:
Originally posted by scott_R

As far as seeing how it "fits" into the directory structure (I'm assuming), you can edit the group permissions to allow them to read the directory, but only edit that one (or group of) files.
If the group has only read permissions on the directory, they will not be able to create new files in that directory.
 
Old 11-08-2003, 08:33 PM   #4
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Original Poster
Rep: Reputation: 30
Thanks for the info all.

saint - does the fie inherit all the permissions of the directory automatically, even if the file has read and write permissions? So if I make the file read/write for the group and make the file's directory read only, the file will become read only?
 
Old 11-08-2003, 10:13 PM   #5
saint
Member
 
Registered: Sep 2001
Location: India
Distribution: Red Hat 9
Posts: 55

Rep: Reputation: 15
No they do not. You have to use the -R option with chmod to set the permission of the files in a directory.
 
Old 11-10-2003, 03:59 AM   #6
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
Quote:
Originally posted by jdruin
does the fie inherit all the permissions of the directory automatically, even if the file has read and write permissions? So if I make the file read/write for the group and make the file's directory read only, the file will become read only?
Permissions on a directory and on a file mean slightly different things.

Directory
Read : Can see files in the directory (e.g. with ls)
Write : Can create and delete files in the directory (even if the files themselves do not have write permissions set).
Execute : Can cd into a directory.

(Note, with write only you can still edit a file as long as you know the name - you just can't do an ls or cd into the directory to take a look).

File
Read : Can view contents of a file
Write : Can edit contents of a file
Execute : Can execute a file.

This does lead to some funny situations. For example, if the directory is writable but the file is not, you can delete the file but not edit it (of course, a sneaky thing to do is copy the contents of the file into another file, edit the copy, delete the original and rename the copy to the original, so if you have write permission on the directory you can override not have write permission on the file if you really want to - as long as you can read the file).

In short, never have write permission on a directory unless you really need it.

Last edited by iainr; 11-10-2003 at 04:00 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort regular users and system users from /etc/passwd joeyBig Red Hat 9 05-29-2008 12:59 AM
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
my web browser "mozilla fire fox" isn't rendering the page, rather opening the page amolgupta Linux - Software 2 07-26-2005 12:41 AM
Jerky mouse when web browsers download web page stodge Linux - Software 1 07-08-2003 10:29 PM
How can I allow my users to have a web page? romanillo Linux - Newbie 1 11-19-2001 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration