LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2010, 03:57 PM   #1
jasonma84@yahoo.com
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: Disabled
Allow ftp user access to modify apache owned files


So here's my issue:

I call PHP code:
PHP Code:
mkdir("new_dir"0777); (sets to 775.not sure why
This creates my folder, however when I log in using my ftp user to add documents to my new directory(apache owned) I get:

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

I've been able to chown using root to "ftp_user" but that doesn't help the next time my PHP code adds another folder (apache owned).

I've tried changing the ownership through PHP code with...
PHP Code:
exec("chown -R ftp_user new_dir"
or
PHP Code:
chown("new_dir""ftp_user"
still no luck.

I've tried logging in as root and usermod to add ftp_user to apache group.. no luck.

What am I doing wrong? I just want my ftp_user to be able to add stuff to my php/apache generated folders.

Last edited by jasonma84@yahoo.com; 10-26-2010 at 10:54 AM. Reason: Typo
 
Old 10-26-2010, 08:46 AM   #2
Mark1986
Member
 
Registered: Aug 2008
Location: Netherlands
Distribution: Xubuntu
Posts: 87

Rep: Reputation: 11
When you create the directory, you set the name to my_new_dir. In both your attempts to change the owner, you use the name new_dir. Could that be the problem?
 
Old 10-26-2010, 09:00 AM   #3
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
Originally Posted by jasonma84@yahoo.com View Post
So here's my issue:

I call PHP code:
PHP Code:
mkdir("my_new_dir"0777); (sets to 775.not sure why
This creates my folder, however when I log in using my ftp user to add documents to my new directory(apache owned) I get:

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

I've been able to chown using root to "ftp_user" but that doesn't help the next time my PHP code adds another folder (apache owned).

I've tried changing the ownership through PHP code with...
PHP Code:
exec("chown -R ftp_user new_dir"
or
PHP Code:
chown("new_dir""ftp_user"
still no luck.

I've tried logging in as root and usermod to add ftp_user to apache group.. no luck.

What am I doing wrong? I just want my ftp_user to be able to add stuff to my php/apache generated folders.
Hi,

I think the chown command not properly issued.

Try to use it like that:

Code:
chown -R ftp_user:new_dir
or

Code:
chown ftp_user:new_dir
Without ":" it does not work, that is why it didn't change the ownership.
 
Old 10-26-2010, 10:58 AM   #4
jasonma84@yahoo.com
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Original Poster
Rep: Reputation: Disabled
Still need help

I know how to change the ownership to the ftp_user using root. The question is, how do I allow ftp_user access to modify the apache owned folders? This would be a permanent fix instead of having to chown every time a new folder is created under apache.
 
Old 10-26-2010, 05:25 PM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Can you post result of "ls -l" for files and directories created by apache, and these created by ftp?
 
  


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
non-root user(s) access to modify and restart apache fishjohn Linux - Security 2 06-01-2010 11:36 PM
[SOLVED] [SAMBA] How to track windows user access , create files /modify files on linux SMB efciem Linux - Server 2 05-16-2010 09:45 AM
assign user to access root owned files eyt Linux - General 1 07-27-2007 04:28 PM
user access to files owned by root jonfa Linux - General 2 07-09-2007 12:58 PM
all users have access to root owned files sakatola Linux - Security 2 07-22-2005 01:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:41 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