Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 03-10-2012, 10:30 PM   #1
Registered: Dec 2009
Posts: 36

Rep: Reputation: 15
setting memlock with limits.conf

My server is linux mint 9, and I'm trying to mount an ecryptfs partition with fstab. The comments on the bug say I need to increase my "memlock"
(Comment #6, and #7)

So I've been looking at /etc/security/limits.conf to try and figure out how I can increase the memlock:
dirac ~ # cat /etc/security/limits.conf | grep -vP '^#'

*		hard	memlock		128
root		hard	memlock		128
isaac           hard    memlock         128
isaac           soft    memlock         32768
As far as I can tell, editing this file does nothing. I must be missing something.
When I log in as either root or isaac, the memlock is still 64:
dirac ~ # ulimit -l
isaac@dirac:/root$ ulimit -l
When I'm root, I can change the limit to 128, but it's only for the length of my login. When I'm 'isaac' I naturally get errors.

The man page says:
Also, please note that all limit settings are set per login. They are not global, nor are they permanent; existing only for the duration of the session.
Which makes me think that logging out and back in should reset it, but it doesn't.
dirac ~ # ps -ef | grep isaac
root     20901 20842  0 23:22 pts/0    00:00:00 grep --colour=auto isaac
dirac ~ # su isaac
isaac@dirac:/root$ ulimit -l
The one thing I haven't done yet is restart the server, but I'm interested in finding out if there's a way to fix this short of restarting.
Old 03-11-2012, 05:00 PM   #2
Registered: Dec 2009
Posts: 36

Original Poster
Rep: Reputation: 15
Restarting didn't help. Instead I used this guide:

I edited:
isaac@dirac:~$ sudo vim /etc/pam.d/common-session
and added:
session required
Edit: Also this was over an ssh server, so I had to set "UsePAM yes" in sshd_config.

To the end.

Last edited by isaaclw; 03-11-2012 at 05:43 PM.


limits.conf, pam, ulimit

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limits.conf digitaldude Linux - Server 2 10-27-2011 01:56 AM
etc/security/limits.conf - what does it do? Ken_1969 Red Hat 5 03-14-2010 04:25 PM
How do I activate limits.conf davidstvz Linux - Newbie 2 09-18-2009 12:46 PM
/etc/security/limits.conf reverse Linux - Security 4 10-20-2007 03:10 PM
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 10:14 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration