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 02-27-2015, 01:58 PM   #1
benygr
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Rep: Reputation: Disabled
How i could restrict the the download file size?


How i could restrict the the downloads file size?
I mean, i don't want restrict the download speed but when the downloads exced x size, i need stop it. What can i do for?
 
Old 02-27-2015, 02:11 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
If you talking about squid, it is here: http://servercomputing.blogspot.in/2...-in-squid.html
 
Old 02-27-2015, 02:22 PM   #3
benygr
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Sorry, i can't get in this site, i live in cuba, i would like to use fully linux on my job but i haven't acced to all the world page...
maybe if you could help with i would thanks so much... and yes is about squid
 
Old 02-27-2015, 02:37 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
These are the contents from the link I mentioned in previous post, the original rights liaise with the author:

Code:
By specifying the maximum allowed size as "reply_body_max_size", Squid can prevent users downloading large files. For example prevent users downloading files larger than 50MB. 
 

 
So when a replay body comes the "reply_body_max_size" parameter checks and deny if file size is larger than 50MB.




Add the below acl configurations to squid configuration file
[root@server ~#]vi /etc/squid/squid.conf


#First create an acl

acl limited_users src 192.168.0.0/24

#Deny downloading larger than 50MB for above acl

reply_body_max_size 50 MB limited_users


Reload squid service

[root@server ~#]service squid reload
 
Old 02-27-2015, 02:45 PM   #5
benygr
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
A lot thanks Terminator.. really a lot thanks... i'm working with rigth now... and work perfectly
 
Old 02-27-2015, 02:47 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're welcome!!! Please mark the thread as solved!!
 
  


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
wget: download if file size does not match any file in folder Si14 Linux - Software 1 04-21-2013 06:00 AM
Restrict download of file of certain size using squid. linuxlover.chaitanya Linux - Server 7 12-06-2008 06:22 PM
To restrict maximum download file size in Squid proxy satishap Linux - Security 3 05-23-2008 02:09 AM
restrict a program not to download a file Menestrel Linux - Networking 1 02-11-2006 02:34 PM
restrict file type & size with vsftpd? zovres Linux - Software 0 06-24-2005 02:23 AM

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

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