LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-05-2006, 03:48 AM   #1
redice
Member
 
Registered: Aug 2005
Location: In My Office
Distribution: Fedora, Ubuntu
Posts: 61

Rep: Reputation: 15
chmod o+w


Hi,

If i use the command chmod o+w to change permissions of a web folder/file eg httpdocs or index.html does this make that particular file/folder under a security threat?
 
Old 03-05-2006, 04:24 AM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Possibly. But the question is, what are you trying to do? Because there is probably a better way to do it.
 
Old 03-05-2006, 05:12 AM   #3
redice
Member
 
Registered: Aug 2005
Location: In My Office
Distribution: Fedora, Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
OK here is the scenario.

Its a webserver running Vhosts. I manage all my domains using Plesk.
When i create a domain and host the website i create a FTP username and password
for the domain owner (also done in plesk)
The domain owner can login with out a problem and they login to their home folder which
would be

/var/www/vhosts/domain.com/

now when the domain owner tries to upload their website into

/var/www/vhosts/domain.com/httpdocs

they get permission errors, that they cannot add files or make changes to the folder.
even to a file within the folder eg

/var/www/vhosts/domain.com/httpdocs/index.html

when i do

chmod o+w /var/www/vhosts/domain.com/httpdocs/
or
chmod o+w /var/www/vhosts/domain.com/httpdocs/index.html

it seems to fix the issue, but i am afrain it could be a security risk
 
Old 03-05-2006, 05:52 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
You need to make sure that /var/www/vhosts/domain.com/httpdocs is owned by the domain owner and their user has write permission. You also needto make sure that the user your Web server runs as has read permission (so it can serve the folder). The chmod o+w command makes the directory writeable by other (anyone not the owner/group of the file, though the owner/group probably can write to it too but their permissions are handled separately).

I would suggest googling around for a good tutorial on Unix permissions. There's no reason to make a directory world writeable just so one user can put files into it.
 
Old 03-05-2006, 11:27 PM   #5
redice
Member
 
Registered: Aug 2005
Location: In My Office
Distribution: Fedora, Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
Hi,

Did abit of research and one of the docs i read suggested
chod 0755

Any warnings before using it?
 
Old 03-05-2006, 11:42 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
That will give the directory owner rwx permissions, the group r-x permissions, and all others also r-x permissions./ Depending on whether or not /var/www/vhosts/domain.com/httpdocs has correct ownerdship and group ownership this may or may not have the effect you want.

Can you do "ls -ld /var/www/vhosts/domain.com/httpdocs" (no quotes) and tell us which user is supposed to be allowed to write into the directory?
 
Old 03-06-2006, 01:58 AM   #7
redice
Member
 
Registered: Aug 2005
Location: In My Office
Distribution: Fedora, Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
this is for the first domain

drwxr-xr-x 5 user1 psaserv 4096 Mar 5 17:01 /var/www/vhosts/domain1.com/httpdocs/ (made the chmod o+w changes then later did chmod 0755 to test)

drwxr-x--- 4 user2 psaserv 4096 Feb 23 01:04 /var/www/vhosts/domain2.com/httpdocs/ (this is the other domain, user2 cannot make changes)

When command groups is typed, psaserv is not shown
 
  


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
chmod...everything +x zchoyt Linux - Software 4 05-15-2005 10:43 AM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 08:53 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
Chmod? subaruwrx Linux - Newbie 3 06-18-2004 06:30 AM
chmod +s or chmod -s excel28 Linux - General 1 09-30-2003 03:55 AM

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

All times are GMT -5. The time now is 10:09 PM.

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