The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Too Many files open shashank_recj UNIX for Advanced & Expert Users 3 08-02-2006 07:57 AM
changing the setting for open files oppai SUN Solaris 1 06-01-2005 02:23 PM
Setting Default Permissions for Files robbieg UNIX for Dummies Questions & Answers 1 11-24-2004 01:26 PM
too many files open and questions lmcanth UNIX for Advanced & Expert Users 7 01-04-2004 05:38 PM
open ASCII files Wing m. Cheng High Level Programming 2 10-27-2001 12:12 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2008
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,313
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Setting the max open files value

I'm trying to set the open files value to 4000 on a SLES 9 system.

Current values:
Code:
ulimit -n
1024
I can set it using this:
Code:
ulimit -n 4000
ulimit -n
4000
But this obviously sets it only for the shell session where I run the command to set it. I want to set this to 4000 for all time.

What I've tried so far:

Extract from /etc/security/limits.conf:
Code:
*       hard    nofile  4000
*       soft    nofile  4000
In the sshd and login files in /etc/pam.d,
Code:
grep pam_limits.so login sshd
login:session  required       pam_limits.so
sshd:session  required       pam_limits.so
What am I missing here? I even tried a reboot (I don't know if it was required, but the server isn't live, so I can experiment a bit :P)
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-11-2008
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,439
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
That looks like everything to me.

You don't have any "sufficient" modules earlier in the list in those pam configuration files by any chance?

I don't have a SLES server handy, but on SuSE I have exactly that configuration and it is working correctly.

/etc/security/limits:
Code:
#@student        -       maxlogins       4
*	soft	nofile	64000	
*	hard	nofile	64000
# End of file
/etc/pam.d/sshd:
Code:
auth     required       pam_unix2.so	# set_secrpc
auth     required       pam_nologin.so
auth     required       pam_env.so
account  required       pam_unix2.so
account  required	pam_nologin.so
password required       pam_pwcheck.so
password required       pam_unix2.so	use_first_pass use_authtok
session  required       pam_unix2.so	none # trace or debug
session  required       pam_limits.so
Result:
Code:
# ulimit -n 
64000
A reboot is not needed, just a new login session when you change this.
Reply With Quote
  #3 (permalink)  
Old 04-13-2008
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,313
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Thanks for checking reborg. I do have an extra line in the /etc/pam.d/sshd file "auth optional pam_lockout.so minuid=100". I doubt that it has anything to do with the limits.conf file though.

An update...

I found that connecting by telnet sets the value to 4000 as set in /etc/security/limits.conf, but using ssh still keeps the old (default) value of 1024. A colleague suggested that this has something to do with the UsePrivilegeSeparation directive in sshd_config.

However this directive was originally not present in my sshd_config file (I don't know the default value), and I tried setting it to both yes and no (restarting sshd each time, ofcourse), but it made no difference.

Again, if anyone has any further suggestions, it would help.

Reborg, if you could tell me what the UsePrivilegeSeparation is set to on your SuSE box, it would help too.
Reply With Quote
  #4 (permalink)  
Old 04-14-2008
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,313
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Fixed the problem! A close look at the sshd_config file showed that Use_PAM wasn't set at all. Set that to yes. Also set ChallengeResponseAuthentication to no.
Code:
UsePAM yes
ChallengeResponseAuthentication no
After this a restart of sshd is all that it takes to fix it.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash exec bash for loop command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix export command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute vi+substitute+end+of+line+character while loop within while loop shell script


All times are GMT -7. The time now is 04:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101