LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-10-2012, 10:30 PM   #1
isaaclw
Member
 
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"
https://bugs.launchpad.net/ecryptfs/...31439591304282
(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:
Code:
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:
Code:
dirac ~ # ulimit -l
64
isaac@dirac:/root$ ulimit -l
64
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:
Quote:
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.
Code:
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
64
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
isaaclw
Member
 
Registered: Dec 2009
Posts: 36

Original Poster
Rep: Reputation: 15
Restarting didn't help. Instead I used this guide:
http://posidev.com/blog/2009/06/04/s...ers-on-ubuntu/

I edited:
Code:
isaac@dirac:~$ sudo vim /etc/pam.d/common-session
and added:
Code:
session required pam_limits.so
----
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.
 
  


Reply

Tags
limits.conf, pam, ulimit



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:28 PM.

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