BASH Users

From Indie IT Wiki
Jump to: navigation, search

Add A New User

sudo adduser <username>

Add A User To The Sudoers Group

sudo usermod -aG sudo <username>

Add A New User As A Member Of Specific Groups

sudo usermod -aG sudo,lpadmin,sambashare <username>

Delete A User

userdel <username>

Delete A User And Their Home Directory

userdel -r <username>

Change User Password

sudo passwd <username>

Follow the prompts.

Change User Password One Liner Batch Mode

echo "username:password" | chpasswd

Show Members Of A Linux Group

groupmems -l -g groupname

Force User To Change Their Password At Next Login

sudo chage -d 0 user