LinuxQuestions.org
Review your favorite Linux distribution.
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-19-2009, 02:38 PM   #1
kdawg123
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Trying to set up a read only FTP user


Hello, I'm trying to set up a read only FTP user; basically, they have the ability to browse a particular images folder and download, but not write (or delete accidentally).

I've got it set up so the FTP user logs in directly to the folder, so I'm good with that; but they still have write permissions.

We have an application built in PHP that copies image uploads to this folder; it also resizes them in the same folder. So in addition to the main FTP user (me) who needs write access to this folder, whatever the Apache/PHP user is (not sure?) also needs write access.

Is there a simple way to affect read/write permissions on a user level? I am about as newbie as they come, so I apologize if this is Linux 101.

Thanks in advance for all your help, Kevin
 
Old 10-19-2009, 02:49 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
The simple way is to just change the folder permissions. Assign the folder and files that they are FTPing into to 644, assuming the user is not the user the directory is assigned to then all they would be able to do is read so long as the user is in group or other. Under 644 the main user the directory belongs to is still able to write to it, however I would advise not using FTP to log in as a user with write or execute privellages, rather using SFTP, FTPS or SCP as these are much more secure.
 
Old 10-19-2009, 03:23 PM   #3
kdawg123
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
r3sistance, thanks so much for your response.

The folder belongs to my primary FTP user. So you're saying if I set the permissions to 644, the primary FTP user will be able to write, and the secondary FTP user will only be able to read.

My question: do I have to do anything to the Apache/PHP user in order to make sure the scripts are able to write to the directory? And if so, how? If it's a lengthy process to describe, I would appreciate any tips on documentation to read up on, and maybe I can post some more specific questions. I guess I'm just not even sure where to start.

Point taken about migrating to SFTP; I'll speak to the client and make this more secure.
 
Old 10-19-2009, 03:40 PM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
With this added, I would place this further, if you ensure you and Apache/PHP are in the same group and use 664, then ensure that the user(s) that can only view are not within the same group and use chmod directory 664 this should give you drw-rw-r-- what means those in the other category can only read. I would test this out before making it live of course.

When bringing this up with your client, I'd advise reminding your client that FTP transmits username and password information in an unencrypted/plain text form that anybody with even the most basic form of packet sniffer near to or along the route can potentially listen too your FTP transmissions and get your login information.

Last edited by r3sistance; 10-19-2009 at 03:41 PM.
 
Old 10-19-2009, 05:30 PM   #5
kdawg123
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for all your help - Kevin
 
  


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
Read a text file and ftp files using bash w/out leaving the ftp prompt dj_tyr Linux - Newbie 6 10-12-2009 07:46 PM
How can I have: Root has Read-Write, user has read only for the boot filesystem? xmrkite Linux - Software 6 10-16-2008 05:31 AM
Why can't I set user read access for mounted ntfs drives? sureshot324 Linux - Software 6 01-08-2006 11:42 PM
How do I set my FTP server to accept passive FTP? imsam Linux - Newbie 3 12-12-2004 07:22 AM
How to add an FTP user who can just read and download the files and folders? yuzuohong Linux - General 1 02-15-2003 01:29 AM


All times are GMT -5. The time now is 01:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration