Friday, March 22, 2013

Users and Groups

Linux is a native multi-accessible system.

Enable and disable root

sudo password root
sudo passwd -l root
To open a shell with root, just
su

Add a new group bar

sudo groupadd bar

Add a new user foo to a group bar

sudo useradd -G bar foo

Add an existing user foo to a group bar

sudo usermod -a -G bar foo

Print current settings

id bar
groups foo

No comments:

Post a Comment