TD1 Managment Users and Groups
TD1 Managment Users and Groups
Q1. Sometimes instructions say that I must “be root.” What does this mean?
Q2. What is the root account and how does it differ from a user account?
Q3. Why would I want to add other user accounts to my system?
Q4. How do I delete users?
Q5. Is there any way to change a user ID?
Q6. Is there a way to disable a user account?
Q7. How do I add or change personal information in an account?
Q8. How do I change a password?
Exercise 1
1. Create some users and stageY totox giving passwords and stageypass totoxpss
2. Audits: an immediate opportunity to log in these accounts, setting up their rep. staff / home.
3. Try to create an existing account.
4. Delete without regret on behalf of totox. His rep. staff he was removed?
Exercise 2
It is about creating a group named trainee whose members are the accounts stageX.
As root :
Exercise 3
What does the following commands:
- # Useradd Fadi
- # Useradd-e 19-9-2010 fadi
- # Useradd-g fadihome fadi
- # Useradd-g-d touficf grit Toufic
- # Useradd-c "Bernard's Account"-d / home / .bernard-e "2003-08-31"
- # Userdel bernard
- # Userdel-r bernard
- # Usermod tony Paschal
- # Usermod-G root, staff, operator-e 2013-12-31 pascal
- # Groupadd-g 666 gnu
- # 667 gnu-g groupmod
- # Groupdel gnu
- # Usermod-d pascalfol Paschal
- # Usermod-d-m pascalfol Paschal
- # Usermod-l Paschal
- # Usermod-u Paschal
Exercise 4
What do the commands in / etc / sudoers:
- Kamal host1 = / sbin / shutdown
- Kamil ALL = ALL
The main orders
Options:
-U uid to set uid
-G group-primary
fixed membership user to a list
G-list
secondary groups (separator, no spaces)
-S shell default award of default shell bash
-C comment
-D dir. staff default in the directory / home
E-expiration-date fixed expiration date of the account (MM / DD / YY)
-M to create the directory
K skel-dir- copies the contents of the rep-skel dir. personnel, by default / etc / skel
SUDO
sudo allows you to run programs with root privileges. We can therefore give permission to a user or group of users
to run programs with root privileges (for exam halt or reboot), in the case of a server with multiple users this can be
handy.
You can also use sudo, if it was just too lazy to raise its rights with su.
/ Etc / sudoers
First form of the useradd command: Summoned in this way, the command creates a new
user account using the values specified (on the command line) and values
system default if the options are not specified. Depending on the options chosen, the new account
will be created and files will be copied in its original workspace.
SYNOPSIS:
useradd-c comment-d homedir expire_date-e-f-g inactive_date initial_group -
-G group,-m-k-p skel_dir passwd-u uid-s shell-ologin
EXAMPLE: add a user.
tux: / # useradd-c "Bernard's Account"-d / home / .bernard-e "2003-08-31" - -
- # Usermod-l Paschal
deactivate the password for Easter
- # Usermod-u Paschal
Enable password for Easter
SYNOPSIS:
usermod-c comment-d homedir-me expire_date inactive_date-f-g -
initial_group-group G,-l loginname-p passwd-u uid-s shell-ol-Ulogin
Example: Add user in the operator group Paschal
(It is already member of the main root gnu and groups and staff)
and he set an expiration date to 31.12.2013:
tux: / # usermod-G root, staff, operator-e 2013-12-31 pascal
userdel The command userdel removes a user account (if any). Option -R allows
in addition to the removal of the contents of the directory and debit of the user, and its
mail directory.
SYNOPSIS:
userdel-rlogin
Example: Remove an undefined users
tux: / # userdel-r bernard