Su prompt when switching users: resource temporarily unavailable

I failed to connect the FTP server authentication with WinSCP today. I felt really strange. Nothing has been moved and everything was normal before.
If I su to FTP user, I keep saying “-bash:fork:Resource permanently unavailable”. If I have no further questions, I have no further questions. If I su to FTP user, I have no further questions.
[root@cls vsftpd]# su bupdate
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
^C
1, first check the disk, memory are OK
[bupdate@cls vsftpd]$ top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32141 bupdate 20 0 16296 2548 1004 R 2.3 0.1 0:00.61 top
root 20 0 19272 1576 1312 S 0.0 0.0 0:06. 43 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00. 00 kthreadd
root RT 3 0 0 0 0 S 0.0 0.0 0:01.45 migration/0
4 root 20 00 0 S 0.0 0.0 0:00.12 ksoftirqd/0
root RT 00 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00. 00 watchdog/0
7 root RT 0 0 0 0 S 0.0 0.0 0:02. 26 migration/1
root RT 8 0 00 0 0 0 S 0.0 0.0 0:00. The migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:00. 25 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 0:27. 92 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:00. 92 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00. 00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:00. 01 ksoftirqd/2

2. Use ulimit-a to get the result

(plain)
view plain
copy

    the core file size (data blocks, -c) 0 seg size (kbytes, -d) unlimited Max nice (-e) 0, the file size (blocks, -f) is unlimited Pending signals (-i) 71679 Max locked memory (in kbytes, -l) 32 Max memory size (kbytes, -m) unlimited open files (-n) 1024 Pipe size (512 bytes, the -p) 8 POSIX message the queues (bytes, – q) 819200 Max rt priority (-r) 0 stack size (10240 kbytes, -s) CPU time (seconds, -t) unlimited Max user the processes (-u) 2047 virtual memory (in kbytes, -v) unlimited file locks (-x) unlimited

     
    3, modify the/etc/security/limits. Conf

    (plain)
    view plain
    copy

    The

      * soft nproc 2047 * hard nproc 16384

      limits. Conf format:

      username | @ groupname type resource limit
      The username | @ groupname: Settings need to be restricted user name, add @ in front of the group name and user name. You can also limit all users with a wildcard *.
      Type: soft, hard and -, soft refers to the current system in effect. Hard indicates the maximum value that can be set in the system. The maximum value of soft cannot exceed the value of hard. Using – indicates that both soft and hard values are set.
      The resource:
      the core – limit the size of the kernel file
      the date – the largest data size
      fsize – maximum file size
      memlock – largest lock memory address space
      nofiles – the maximum number of open file
      RSS – maximum persistent set size
      stack – stack size
      maximum CPU – units of minutes up CPU time
      noproc – process the maximum number of
      the as – Address space limit
      maxlogins – the maximum number of logins allowed by this user
      For the lims.conf file configuration to take effect, you must ensure that the pam_lims.so file is added to the startup file.
      session required /lib/security/pam_limits. So.
      session required /lib/security/pam_limits
       
      4. Or modify the /etc/profile file
      Ulimit [- acdfHlmnpsStvw] [size]
      Parameter details:

      -a>
      size: Sets the maximum value of the core file.
      -c size: Sets the maximum value of the core file. Blocks
      -d Size: Sets the maximum number of blocks in the data segment.
      -f size: Set the maximum value of the file to create. Blocks
      -l Size: Sets the maximum number of processes locked in memory.
      -m Size: Sets the maximum amount of resident memory that can be used. Kbytes
      -n Size: Sets the maximum number of file descriptors that the kernel can open at the same time. N
      -p Size: Sets the maximum value of the pipeline buffer.
      -s size: Sets the maximum value of the stack.
      -t size: Set the maximum CPU usage time. Seconds
      -v size: Sets the maximum value of virtual memory. Unit: kbytes
      Add something like ulimit -f 1000 to the end of /etc/profile so that each session will take effect when logged in.

      Ps:

      Permanent change

      remove
      Limits on maximum number of processes and maximum number of files open for Linux systems:

      Vi/etc/security/limits. Conf

      # Add the following line

      * Soft noproc 11000 # soft connection

      * Hard noproc 11000 # hard connection

      * soft nofiles 4100

      * hard nofiles 4100

      Note: * represents for all users, noproc represents the maximum number of processes, nofile represents the maximum number of open files

      Refer to the address: http://blog.csdn.net/jlds123/article/details/9146865

Read More: