With PAM limits, restrict each member of the students group to two simultaneous logins and a hard process limit of 100.
Choose the correct /etc/security/limits.conf lines.
Which setting is appropriate?
In limits.conf, @GROUP selects a group, hard selects the hard limit, and maxlogins and nproc are the relevant items. PAM must load pam_limits.
Detailed explanation
students soft login 2
students soft process 100Incorrect. It uses the wrong group/type and item names.
Incorrect. It uses the wrong group/type and item names.
@students hard nofile 2
@students hard memlock 100Incorrect. It limits open files and locked memory instead.
Incorrect. It limits open files and locked memory instead.
%students deny login 2
%students deny nproc 100Incorrect. It does not use the limits.conf domain/type format.
Incorrect. It does not use the limits.conf domain/type format.
@students hard maxlogins 2
@students hard nproc 100Correct. It sets hard maxlogins and nproc limits for the group.
Correct. It sets hard maxlogins and nproc limits for the group.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '@students hard maxlogins 2' '@students hard nproc 100'Expected result
@students hard maxlogins 2
@students hard nproc 100Key points
- @ selects a group
- maxlogins
- nproc
Notes
- Environment: pam_limits設定行の表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.