linux:users_and_groups
This is an old revision of the document!
Table of Contents
Users and Groups
Create User
useradd -g USERS_MAIN_GROUP -G SECONDARY_GROUP1,SECONDARY_GROUP2 -m -d /home/USERNAME USERNAME
Create Group
groupadd GROUPNAME
Add Secondary Group to User
usermod -a -G GROUPNAME USERNAME
Change Password
Run as root
passwd USERNAME
Or run as yourself to change your own password
passwd
Change password without interaction (e.g. withing a script)
echo "username:new_password" | chpasswd
Lock Password
passwd -l USERNAME
Unlock Password
passwd -u USERNAME
Delete Password
Preferred way of doing it as you don't even get the option of trying to log in.
passwd -d USERNAME
See User Limits
Display max number of processes, etc for a particular user.
ulimit -a USERNAME
Set User Limits
Set max number of processes for a user for just that session
ulimit -Su USERNAME
linux/users_and_groups.1590345426.txt.gz · Last modified: (external edit)
