Solved

How to setup ulimit to unlimited value for some user id

Posted on 2011-03-11
3
1,673 Views
Last Modified: 2012-05-11

How to setup ulimit to unlimited value for some user id in /etc/security/limits, please provide me exact steps or command line. My system running on IBM AIX 5.3.

Thanks
0
Comment
Question by:sams20
  • 2
3 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35113053
Hi again,

in /etc/security/limits "unlimited" is expressed as "-1".

Which limit are you talking about?

There are several:

* fsize      - soft file size in blocks
* core       - soft core file size in blocks
* cpu        - soft per process CPU time limit in seconds
* data       - soft data segment size in blocks
* stack      - soft stack segment size in blocks
* rss        - soft real memory usage in blocks
* nofiles    - soft file descriptor limit
* fsize_hard - hard file size in blocks
* core_hard  - hard core file size in blocks
* cpu_hard   - hard per process CPU time limit in seconds
* data_hard  - hard data segment size in blocks
* stack_hard - hard stack segment size in blocks
* rss_hard   - hard real memory usage in blocks
* nofiles_hard - hard file descriptor limit

Basically you have three options to set a limit.

Assuming that you want to set "fsize" to "unlimited" for a userid "myuser" (hard and soft, see below):

1) chsec

chsec -f /etc/security/limits -s myuser -a "fsize_hard=-1" -a "fsize=-1"

2) chuser

chuser "fsize_hard=-1" "fsize=-1" myuser

3) edit /etc/security/limits directly.

Add:

myuser:
        fsize = -1
        fsize_hard = -1


Difference between "hard" and "soft" limits:

Soft limits are ones that the user can move up or down using "ulimit" within the permitted range set by hard limits.

Hard limits are set by the superuser. The user cannot raise his limits above such values.


wmp




0
 

Author Comment

by:sams20
ID: 35113276


Your description is right, but once I setup an unlimited, how I set back to previous limit or ulimit or is it the default one mentioned top of the limits file.

Thanks
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35113367
Defauts are listed in /etc/security/limits under the "default:" stanza.

These values take effect when there is no explicit setting under the user's stanza.

To set back to default it's sufficient to remove an attribute from the user's stanza.

Removing an attribute is done by setting it to the empty string with chsec or chuser:

chsec -f /etc/security/limits -s myuser -a "fsize_hard=" -a "fsize="

chuser "fsize_hard=" "fsize=" myuser

To reset all limits of a particular user remove the whole stanza including the following attributes up to, but not including the next stanza, if there's any.

Edit /etc/security/limits manually to achieve this, because neither chsec nor chuser can remove a complete stanza.


wmp
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AIX Server 10 87
Unix / Linux grid computing 5 157
unix example issues 18 90
Adding a continue option in a script 9 40
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question