LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   regarding command "ulimit" (https://www.linuxquestions.org/questions/linux-newbie-8/regarding-command-ulimit-618551/)

deepak_cucek 02-04-2008 06:12 AM

regarding command "ulimit"
 
--------------------------------------------------------------------------------

Hi

i am totally new to this forum as well as linux...
as per my knowledge by using "ulimit" we can restrict the size of file that can create by user.

but in one folder i make the ulimit as 1kb by "ulimit -f 1"
but still i can create the file with more than 1kb ..
i need completely user need to prevent for creating file in the particular folder

[sorry for bad english]

bathory 02-04-2008 08:18 AM

Quote:

i need completely user need to prevent for creating file in the particular folder
If you don't want a user to be able to create file in a specific folder, then you should change the folder rights accordingly.
If you want the user to be able to create files smaller that 1K, then you can edit /etc/security/limits.conf and add the line:
Code:

@username hard fsize 1

deepak_cucek 02-04-2008 10:48 PM

dude it is not working for me.......
i made the change as per your instructions...

NB : i enterd as "root" user

bathory 02-05-2008 02:06 AM

You can try
Code:

username hard fsize 1
without the "@".
In redhat it works both ways, but I've tested it on a Suse box and it's not working with the "@"
What distro are you using anyway?

thorgal31 02-05-2008 02:10 AM

You also have to add the line

Code:

session required /lib/security/pam_limits.so
to the pam config file : /etc/pam.d/{gdm,kdm,login} according to your config.

See the following link for more details : http://www.kernel.org/pub/linux/libs...x-PAM_SAG.html


All times are GMT -5. The time now is 10:06 PM.