LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 04: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 04:08 PM.
 
Old 06-13-2011, 04:58 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
@ 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 05:33 PM.
 
Old 06-14-2011, 08: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, 01:40 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
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



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 10:11 PM
limit file size ust Linux - General 2 02-24-2005 07:33 AM
File Size Limit?? Manuel-H Linux - Software 1 04-16-2004 03:23 AM
File size limit petway56 Linux - General 4 05-07-2003 11:19 PM
file size limit jaysan Slackware 5 07-12-2002 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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