Solved

How to setup ulimit to unlimited value for some user id

Posted on 2011-03-11
3
1,642 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now