Some of what you want can be done with /etc/security/limits.conf, which lets you set hard and soft limits for things like memory use and maximum number of processes, controlled by user or group.
---------- Post updated at 12:42 PM ---------- Previous update was at 12:56 AM ----------
Whether it's necessary to set both soft and hard values for each item ? I'm able to set maxlogins with hard limit only..but I'm not able to set memlock and nproc
You do not need to: a "hard limit" is like a wall: once set, it can't be changed (by the user, that is). A "soft limit" is different: it is set, but the user can change it (up to the maximum of the hard limit) himself.