Solved

How to setup ulimit to unlimited value for some user id

Posted on 2011-03-11
3
1,709 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

733 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