LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-28-2009, 01:33 AM   #1
Silver565
Member
 
Registered: Jul 2007
Distribution: Ubuntu, Windows, Freenas
Posts: 96

Rep: Reputation: 15
Freenas Ftp + users and permission problem


I'm having trouble with freenas and ftp users. I cannot seem to make it so any user created can download the files from the server despite who created them. I would like it so the files cannot be deleted, Just downloaded. Is there anything i should look into? (i'm using filezilla as the client)
 
Old 06-28-2009, 01:52 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
I think that if the files have read permissions but not write permissions, then they may be copied but not deleted. In the folder where you are keeping the files available for ftp transfer, you can execute the command
Code:
chmod ugoa+r-w *
Note, you may have to be root or use sudo depending on the permissions and ownership of the files.
Cheers,
jdk
 
Old 06-28-2009, 02:19 AM   #3
Silver565
Member
 
Registered: Jul 2007
Distribution: Ubuntu, Windows, Freenas
Posts: 96

Original Poster
Rep: Reputation: 15
Ok thanks. However any user can upload and delete existing files. But if a file is uploaded by user "A" then user "B" cannot download a file uploaded by user "A".

But! user "B" can delete all files uploaded by user "A"

I hope that makes sense :s
 
Old 06-28-2009, 02:48 AM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
Originally Posted by Silver565 View Post
Ok thanks. However any user can upload and delete existing files. But if a file is uploaded by user "A" then user "B" cannot download a file uploaded by user "A".

But! user "B" can delete all files uploaded by user "A"

I hope that makes sense :s
No, it doesn't. Is that what you want? or is that what you're getting at the moment?
cheers,
jdk
 
Old 06-28-2009, 03:26 AM   #5
Silver565
Member
 
Registered: Jul 2007
Distribution: Ubuntu, Windows, Freenas
Posts: 96

Original Poster
Rep: Reputation: 15
Ah sorry. I'll try and explain it again

example:

Lets say "john" logs into the server with Filezilla and uploads a file called example.doc
Then "mike" logs into the server with Filezilla and tries to download example.doc, mike will be unable to download that file. However! mike can delete any file that is uploaded by john or mike.

I'm trying to make it so that if "john" uploads a file any user whether it's mike, chris, beca etc can download that file.

Basically any user should be able to download a file uploaded by another user but should NOT be able to delete anything

is that better?

Thanks
 
Old 06-28-2009, 03:54 AM   #6
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Yes,...I think. Isn't that what I addressed originally? I'm still unclear as to whether you tried my suggestion or not. Is the problem that users are constantly adding new files and you want to make sure that they are assigned the +r-w permissions so they can be copied but not deleted?
cheers,
jdk
 
Old 06-28-2009, 11:51 PM   #7
Silver565
Member
 
Registered: Jul 2007
Distribution: Ubuntu, Windows, Freenas
Posts: 96

Original Poster
Rep: Reputation: 15
By using that command you listed. Would that be in the shell from the login via a browser?
 
Old 06-29-2009, 12:32 AM   #8
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
You could run a script from the server (where the files are up and downloaded) that would set those permissions every x minutes depending on how long you wanted to leave the newly uploaded files vulnerable to deletion. There are more clever ways of doing this but I'm still not quite sure what you want. For example you could keep the upload and download folders separate on the the server and copy the upload contents to the download folder every x minutes (user cron or a crontab setting, for example) but there are loads of other ways of doing this.
cheers,
jdk
 
Old 06-29-2009, 05:39 AM   #9
Silver565
Member
 
Registered: Jul 2007
Distribution: Ubuntu, Windows, Freenas
Posts: 96

Original Poster
Rep: Reputation: 15
Ah ok..

Well here's the setup

When a user logs in there are 4 drives that the user can access. All i want is that any user can access anything. Download and upload whatever they want. the only limitation on their "user" is that they cannot delete anything.

For example if "john" logs in and access the drive called 17gb, he can upload and download whatever he wants to that drive/folder. But cannot delete anything. Then any other user can download what john has uploaded. At the moment i'm stuck, as if a user called "john" (for example) uploads a file, no one else can download it.

so would chmod ugoa+r-w /mnt/17gb be a suitable command?
 
Old 06-29-2009, 09:17 AM   #10
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
The problem is that if you restrict the folder where the users upload stuff to, to -w then how can the upload stuff there. Also I am not TOTALLY sure that any file copied to a folder with automatically inherit the permissions of that folder. I'd say the two folder solution is the simplest (one folder for uploads with +w permission and then at regular intervals copy those files to the download folder and changing permissions to -w).
Get it?
cheers,
jdk
 
Old 06-29-2009, 09:06 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,847

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584
Try putting them all in the same group and using setgid http://en.wikipedia.org/wiki/Setuid#...on_directories for read/ownership issues.

However, you need dir +w to write OR delete a file, so I don't think you can do it with perms (or even ACLS).
http://content.hccfl.edu/pollock/AUn...ermissions.htm

I think(?) you'd need to customise the FTP server cmd options to disallow 'rm' ie remove it as an avail cmd.
I could be wrong
 
  


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
Permission problem with virtual users Datakraft Linux - Server 2 06-10-2009 01:14 AM
Using suse 10.0 can only use ftp to freeNAS server sirius57 Linux - Server 0 05-19-2008 10:32 PM
FTP file permission problem blueAlien Linux - Server 4 09-24-2007 11:09 AM
can use ftp but not nfs client in freeNAS sirius57 Linux - Networking 2 08-17-2007 01:27 PM
Ftp permission problem 360 Linux - Networking 4 02-19-2002 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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