LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-13-2011, 05:03 PM   #1
sang_froid
Member
 
Registered: Oct 2006
Posts: 179

Rep: Reputation: 15
limit on file size


Hi,

I was just testing specifying limit on file size to a user and have added the following to /etc/security/limits.conf

bob soft fsize 100

This basically should have said not to allow bob to create anyfile greater than 100Kb in size.

But the interesting thing is, if bob already has any file which is greater than 100Kb in size, it even doesn't allow to log him into the system both from console and SSH. Also nothing is logged in logs..

How do I configure it so that, bob can login to the system even though he has any file greater than 100Kb (but doesn't allow him to create file which are greater than 100Kb) ??

Last edited by sang_froid; 06-13-2011 at 05:08 PM.
 
Old 06-13-2011, 05:58 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Hi there,

The reason he is not able to login because there is just one limit set i.e. soft limit and that is acting as a hard limit as well because you have not specified the hard limit exclusively.

You should edit the line to read as follows:

bob soft fsize 100
bob hard fsize 5000

Which will then set a soft limit of 100 KB and hard limit of 5 MB for Bob. And yes if he is not having any file which is bigger than 5 MB then he will be able to login.

Have a look at the following link: http://www.cyberciti.biz/tips/linux-...r-process.html

I hope this helps.

Last edited by T3RM1NVT0R; 06-13-2011 at 06:33 PM.
 
Old 06-14-2011, 09:48 AM   #3
sang_froid
Member
 
Registered: Oct 2006
Posts: 179

Original Poster
Rep: Reputation: 15
ok... in that case, if I specify both hard and soft limits to the user and if the user exceeds his limit, why is he disallowed to even login ?

He should have only been supposed to disallow create files which are greater than 5Mb in that case. It should have been something like he should have been able to login, create any number of files less than 5Mb, but not a single file greater than 5Mb.



Quote:
Originally Posted by T3RM1NVT0R View Post
Hi there,

The reason he is not able to login because there is just one limit set i.e. soft limit and that is acting as a hard limit as well because you have not specified the hard limit exclusively.

You should edit the line to read as follows:

bob soft fsize 100
bob hard fsize 5000

Which will then set a soft limit of 100 KB and hard limit of 5 MB for Bob. And yes if he is not having any file which is bigger than 5 MB then he will be able to login.

Have a look at the following link: http://www.cyberciti.biz/tips/linux-...r-process.html

I hope this helps.
 
Old 06-14-2011, 02:40 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,422

Rep: Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157
Quote:
Originally Posted by sang_froid View Post
ok... in that case, if I specify both hard and soft limits to the user and if the user exceeds his limit, why is he disallowed to even login ?
Heh. This is a new one on me! Indeed... "why t'hell not?"

Are you certain that login is disallowed? If so, are you certain that you are "using the whistles and bells" correctly?!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Size limit? compu73rg33k Linux - Software 1 02-27-2005 11:11 PM
limit file size ust Linux - General 2 02-24-2005 08:33 AM
File Size Limit?? Manuel-H Linux - Software 1 04-16-2004 04:23 AM
File size limit petway56 Linux - General 4 05-08-2003 12:19 AM
file size limit jaysan Slackware 5 07-12-2002 04:43 AM


All times are GMT -5. The time now is 07:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration