2
Most read
4
Most read
5
Most read
If there is any issue at setup or connection contact support@k21technologies.com
Overview of Unix
Activity Guide 4
[Edition 1]
[Last Update 130815]
For any issues/help contact : support@k21technologies.com
If there is any issue at setup or connection contact support@k21technologies.com
USER AND GROUP ADMINISTRATION
Part 1 USER ADMINISTRATION
In Linux/Unix user is one who uses the system. There can be at least one or more than one users in Linux
at a time. Users on a system are identified by a username and a userid. The username is something that
users would normally refer to, but as far as the operating system is concerned this referred to using the
user id(or uid). The username is typically a user friendly string. such as your name, whereas the user id is
a number. The words username and userid are often(incorrectly) used interchangeably. The userid
numbers should be unique(one number per user). If you had two usernames with the same user id,
effectively there permissions would be the same and the files that they create would appear to have
been created by the same user. This should not be allowed and the useradd command will not allow
usernames to share the same userid.
Some Important points related to users:
 Users and groups are used to control access to files and resources.
 Users login to the system by supplying their username and password.
 Every file on the system is owned by a user and associated with a group.
 Every process has an owner and a group affiliation, and can only access the resources its owner
or group can access.
 Every user of the system is assigned a unique user ID number (the UID)
 Users name and UID are stored in /etc/passwd
 Users password is stored in /etc/shadow in encrypted form.
 Users are assigned a home directory and a program that is run when they login(usually a shell)
 Users cannot read, write or execute each others files without permission.
Types of Users in Linux and their attributes
TYPE EXAMPLE USER ID(UID) GROUP ID
(GID)
HOME
DIRECTORY
SHELL
Super User Root 0 0 /root /bin/bash
System User ftp,ssh,apache,
nobody
1 to 499 1 to 499 /var /ftp, etc /sbin/nologin
Normal User Visitor, oracle,
etc
500 to 60000 500 to 60000 /home /user
name
/bin/bash
If there is any issue at setup or connection contact support@k21technologies.com
In Linux there are three types of users
1.Super user or root user : Super user or the root user is the most powerful user. He is the administrator
user.
2.System user : System users are the users created by the softwares or applications. For example if we
install apache it will create a user apache. These kinds of users are known as system users.
3.Normat user: Normal users are the users created by root user. They are normal users like Oracle,
rahul etc. Only the root user has the permissions to create or remove a user.
Whenever a user is created in Linux things created by default:-
 A home directory is created(/home/username)
 a mail box is created(/var/spool/mail)
 unique UID & GID are given to user.
Linux uses UPG(User Private Group) scheme
 It means that whenever a user is created is has its own private group.
 For example if a user is created with the name "rahul", then primary group for that user will be
"rahul" only
There are two important files a user administrator should be aware of
1."/etc/passwd"
2."/etc/shadow"
Each of the above files have specific formats
1."/etc/passwd"
If there is any issue at setup or connection contact support@k21technologies.com
The above fields are
 root=name
 x=link to password file i.e./etc/shadow
 0 or 1=UID(user id)
 0 or 1=GID(group id)
 root or bin = comment (brief information about the user)
 /root or /bin = home directory of the user
 /bin/bash or /sbin/nologin = shell
2."/etc/shadow"
The above fields are
 root = Username
 $1$NPIb8zxz$d9t4mZUy/wlqhlFAsCwAx. = Encrypted Password
 16416 = Days since that password was last changed.
 0 = Days after which password must be changed.
 99999 = Days before password is to expire that user is warned.
 7 = Days after the password is expires that the user is disabled.
 A reserved field
Password Complexity Requirements:
 a root user can change a password of self and of any user in the system, there are no rules for
root to assign a password. Root can assign any length of password either long or short, it can be
alphabet or numeric or both. On the whole there is no limitation for root for assigning a
password.
 A normal user can change only its password. a valid password for a normal user should adhere
to the following rules.
 it should be at least 7 characters but not more the 255 characters.
 At least one character should be Upper Case.
 At least one character should be Lower Case
 At least one character should be a symbol, and one character should be a number.
 It should not match the pervious password.
 It cannot have sequence(ex:123456 or abcdef)
 The login name and the password cannot be same.
If there is any issue at setup or connection contact support@k21technologies.com
Note: for security reasons don't keep the password based on date of birth because it can easily be
hacked.
Creating a user
The Syntax for creating a user in Linux is #useradd <option> <username>
Options are:
 -u userid
 -G Secondary Group id
 -g Primary Group id
 -d home directory
 -c comment
 -s shell
Let's create a user with default attributes.
 when no option is used with useradd command the options like UID,GID,home dir and shell will
be assigned default
 #useradd <username>
Observe that the uid, gid, home dir, and shell is assigned automatically.
If there is any issue at setup or connection contact support@k21technologies.com
let's create a user with our own attributes
 Name = pepsi
 uid = 508
 gid = 508 (primary group)
 homedir = /home/pepsi
 comment=beverages
 #useradd pepsi -u 508 -g 508 -d /home/pepsi -c beverages
Assigning a password to the user:
 As a root user we can assign any password to any user.
 The syntax for assigning a password is
 #passwd <username> to assign a password to a specific user, only root can assign password to
other user.
Modifying the user's attributes
 After creating a user if we need to modify the attributes of user like changing uid, changing
secondary group id or adding a comment, locking or unlocking the user account, can be done by
following command
 usermod <options> <username>
 All the options which are used with useradd command can be used and also the following
below:
 -l to change login name
 -L to LOCK account
 -U to UNLOCK account
 ex.#usermod -l newname oldname (changing the name of the user)
 ex.#usermod -L newname to lock the user account
If there is any issue at setup or connection contact support@k21technologies.com
 ex.#usermod -U newname to unlock the user account
 Note:- When an account is locked it will show! (Exclamation mark) in /etc/shadow file
Locking and unlocking a user account
 To lock a user a/c use the following #usermod -L <username>
 verify it in /etc/shadow file, it shows exclamation mark before user a/c or try login as pepsi
 unlock the above user a/c use the following #usermod -U <username>
 Verify it in /etc/shadow file, it shows exclamation mark before user a/c or try login as oracle
 Try login as a user pepsi
The password parameters
 For any user we can set the parameters for the password, like min and max password age,
password expiration warnings and a/c expiration date etc
 To view the advanced parameters of the user, use #chage -l <user name>
 #chage -l pepsi
If there is any issue at setup or connection contact support@k21technologies.com
 Last password change: when the password was change last time.
 Password expires: Password expiry date
 Password inactive: After password expiry grace period before the account gets locked.
 Account expires: Date on which the account expires.
 Minimum number of days b/w password change: Once the password is changed, it cannot be
changed until a min period of specified date [0] means never.
 Max number of days b/w password change: After changing the password how long it will be
valid for.
 Number of days of warning before password expires: start of warnings to change the
password, no. of days before the password expires.
Changing the password parameters can be done by two ways:-
 chage <user name>
 chage <option> <value> <username>
Let's see the first method and then the other. To set the password parameters of a user "pepsi" to
 Min password age: 2 days
 Max password age: 7 days
 password expiration warnings: 2 days before password expires
 Password inactive[-1]:0 same day account is locked after password expiry.
 A/C expiration date: 2014-12-31(dec 31st 2014)
If there is any issue at setup or connection contact support@k21technologies.com
 The second method is for, if you want to change a particular field of password aging policy
 #chage <option> <value> <username>
 -m for Min password age
 -M for Maximum password age
 -d for last time the password is changed.
 -W Password expiration warnings
 -I Password inactive [-1 means inactive]
 -E A/c expiration date
Let's see how to change only the account expiration date
Likewise we can use any option listed above and change any particular field in password aging
parameters
Deleting a User:
 To delete a user the sysntax used is
 #userdel<username> it will only delete the user but home directory will be there. To delete the
user with its home directory use the following command #userdel -r pepsi
PART II GROUP ADMINISTRATION
GROUPS
 Users are assigned to groups with unique group ID numbers(the GID)
 The group name and GID are stored in /etc/group
 Each user is given their own private group
 They can also be added to their groups to gain additional access.
 All users in a group can share files that belong to the group.
Each user is a member of at least one group, Called a primary group. In addition, a user can be a
member of an unlimited number of secondary groups. Group membership can be used to control the
If there is any issue at setup or connection contact support@k21technologies.com
files that a user can read and edit. For example, if two users are working on the same project you might
put them in the same group so they can edit a particular file that other users cannot access.
 A user's primary group is defined in the /etc/passwd file and secondary groups are defined in
the /etc/group file.
 The primary group is important because files created by this user will inherit that group
affiliation.
Creating a group with default options:
 Syntax for creating group is #groupadd <name of the group>
creating a group with user specified group id(GID)
 #groupadd <option><name for the group>
 #groupadd -g 595 laptop
 verify it in /etc/group
If there is any issue at setup or connection contact support@k21technologies.com
Modifying the properties of the group
 Syntax is groupmod <option> <argument><group name>
 The options are below:-
 -g to change the group id
 -o to override the previous assigned id, if it matches with the new one.
 -n to change the group name.
Changing the GID of the group
 #groupmod -g 600 laptop
 verify it in /etc/group
Changing the name of the group
 Syntax #groupmod -n <new name> <existing name>
 groupmod -n lappy laptop
If there is any issue at setup or connection contact support@k21technologies.com
Adding and Removing members to a group
 Adding the members to the group is to add users to the group. To add the members to the
group the syntaxes are
 To add single user to the group #usermod -G <group name> <user name>
 #usermod -G computer mouse
tail /etc/passwd tail /etc/group
Adding multiple single or multiple users to the group with various attributes
#gpasswd <option> <argument> <group name>
Options:
 -M For Adding Multiple users to a group
 -A For Adding a group Administrator.
 -a for adding a single user to a group.
 -d removing a user from a group.
If there is any issue at setup or connection contact support@k21technologies.com
#gpasswd -M<user>,<user>,<user><group>
#gpasswd -M keyboard,speakers,ram computer
Adding a single user using gpasswd
#gpasswd -a hardisk computer
If there is any issue at setup or connection contact support@k21technologies.com
Making a user as an administrator
#gpasswd -A ram computer (verify it in /etc/gshadow)
removing a user from the group #gpasswd -d speakers computer
To add and remove groups you can also use graphical tool in linux
#system-config-users &
If there is any issue at setup or connection contact support@k21technologies.com
If there is any issue at setup or connection contact support@k21technologies.com
=============End of the Activity 4 Guide========

More Related Content

PPT
NTFS.ppt
PPT
Basic 50 linus command
PDF
Users and groups in Linux
PPT
Linux basics
PPTX
Linux User Management
PPTX
Top 10 Hadoop Shell Commands
ODP
What is Ubuntu - presentation
PDF
Linux OS presentation
NTFS.ppt
Basic 50 linus command
Users and groups in Linux
Linux basics
Linux User Management
Top 10 Hadoop Shell Commands
What is Ubuntu - presentation
Linux OS presentation

What's hot (20)

PDF
Lesson 2 Understanding Linux File System
PPSX
User Administration in Linux
PPTX
Linux fundamentals
PPT
Linux file system
PPTX
User and groups administrator
PPTX
Unix Linux Commands Presentation 2013
PDF
Linux Presentation
PPTX
Linux standard file system
PPTX
Users and groups
PDF
NTFS file system
PDF
PDF
Part-1.pdf
PPT
Linux Administration
PPTX
Basic unix commands
PDF
Employee Time and Task Tracking System
PPTX
Gnome and kde
PPTX
Cpu scheduling
PPTX
Linux ppt
PDF
Linux systems - Linux Commands and Shell Scripting
PDF
Process management
Lesson 2 Understanding Linux File System
User Administration in Linux
Linux fundamentals
Linux file system
User and groups administrator
Unix Linux Commands Presentation 2013
Linux Presentation
Linux standard file system
Users and groups
NTFS file system
Part-1.pdf
Linux Administration
Basic unix commands
Employee Time and Task Tracking System
Gnome and kde
Cpu scheduling
Linux ppt
Linux systems - Linux Commands and Shell Scripting
Process management
Ad

Similar to User and group administration in Linux (20)

PPTX
Lecturehjiwiiiwiiiwiiiiwiiijjwjiwii.pptx
PPTX
7 - User Administration in Red Hat
PDF
ManagingLocalLinuxUsersandGroups(2)
PPTX
Chapter 3 LectureChapter 3 LectureChapter 3 Lecture.pptx
PDF
Unit 6 adding new users and storage
PDF
Linux fundamental - Chap 13 account management
PPT
PPT
Unix Administration 3
PPT
06 users groups_and_permissions
PDF
Manage Local Users and Groups - RHCSA (RH124)
PPTX
User management
PPTX
Linux Fundamentals - An Intro to Linux Fundamentals
PDF
7 unixsecurity
PPT
Week7 downloading and installing software (1).ppt
PPT
Week7. linux. operating. system. .ppt
PDF
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
PPTX
Presentation1
PPT
Host security
PPT
Host security
Lecturehjiwiiiwiiiwiiiiwiiijjwjiwii.pptx
7 - User Administration in Red Hat
ManagingLocalLinuxUsersandGroups(2)
Chapter 3 LectureChapter 3 LectureChapter 3 Lecture.pptx
Unit 6 adding new users and storage
Linux fundamental - Chap 13 account management
Unix Administration 3
06 users groups_and_permissions
Manage Local Users and Groups - RHCSA (RH124)
User management
Linux Fundamentals - An Intro to Linux Fundamentals
7 unixsecurity
Week7 downloading and installing software (1).ppt
Week7. linux. operating. system. .ppt
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Presentation1
Host security
Host security
Ad

More from Mohammed Yazdani (8)

DOCX
Installing webmin on linux
DOCX
Configuring vnc server in linux
DOCX
Administering Remote System in Linux
DOCX
Overview on Linux
PDF
Network configuration in Linux
PDF
Solaris 10 installation on vmware
PDF
Backup and restore in linux
PDF
Installation of Oracle Linux 5.4 32 bit on vmware
Installing webmin on linux
Configuring vnc server in linux
Administering Remote System in Linux
Overview on Linux
Network configuration in Linux
Solaris 10 installation on vmware
Backup and restore in linux
Installation of Oracle Linux 5.4 32 bit on vmware

Recently uploaded (20)

PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
Human Computer Interaction Miterm Lesson
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
Presentation - Principles of Instructional Design.pptx
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Ensemble model-based arrhythmia classification with local interpretable model...
CEH Module 2 Footprinting CEH V13, concepts
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
SGT Report The Beast Plan and Cyberphysical Systems of Control
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
LMS bot: enhanced learning management systems for improved student learning e...
giants, standing on the shoulders of - by Daniel Stenberg
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Human Computer Interaction Miterm Lesson
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf

User and group administration in Linux

  • 1. If there is any issue at setup or connection contact [email protected] Overview of Unix Activity Guide 4 [Edition 1] [Last Update 130815] For any issues/help contact : [email protected]
  • 2. If there is any issue at setup or connection contact [email protected] USER AND GROUP ADMINISTRATION Part 1 USER ADMINISTRATION In Linux/Unix user is one who uses the system. There can be at least one or more than one users in Linux at a time. Users on a system are identified by a username and a userid. The username is something that users would normally refer to, but as far as the operating system is concerned this referred to using the user id(or uid). The username is typically a user friendly string. such as your name, whereas the user id is a number. The words username and userid are often(incorrectly) used interchangeably. The userid numbers should be unique(one number per user). If you had two usernames with the same user id, effectively there permissions would be the same and the files that they create would appear to have been created by the same user. This should not be allowed and the useradd command will not allow usernames to share the same userid. Some Important points related to users:  Users and groups are used to control access to files and resources.  Users login to the system by supplying their username and password.  Every file on the system is owned by a user and associated with a group.  Every process has an owner and a group affiliation, and can only access the resources its owner or group can access.  Every user of the system is assigned a unique user ID number (the UID)  Users name and UID are stored in /etc/passwd  Users password is stored in /etc/shadow in encrypted form.  Users are assigned a home directory and a program that is run when they login(usually a shell)  Users cannot read, write or execute each others files without permission. Types of Users in Linux and their attributes TYPE EXAMPLE USER ID(UID) GROUP ID (GID) HOME DIRECTORY SHELL Super User Root 0 0 /root /bin/bash System User ftp,ssh,apache, nobody 1 to 499 1 to 499 /var /ftp, etc /sbin/nologin Normal User Visitor, oracle, etc 500 to 60000 500 to 60000 /home /user name /bin/bash
  • 3. If there is any issue at setup or connection contact [email protected] In Linux there are three types of users 1.Super user or root user : Super user or the root user is the most powerful user. He is the administrator user. 2.System user : System users are the users created by the softwares or applications. For example if we install apache it will create a user apache. These kinds of users are known as system users. 3.Normat user: Normal users are the users created by root user. They are normal users like Oracle, rahul etc. Only the root user has the permissions to create or remove a user. Whenever a user is created in Linux things created by default:-  A home directory is created(/home/username)  a mail box is created(/var/spool/mail)  unique UID & GID are given to user. Linux uses UPG(User Private Group) scheme  It means that whenever a user is created is has its own private group.  For example if a user is created with the name "rahul", then primary group for that user will be "rahul" only There are two important files a user administrator should be aware of 1."/etc/passwd" 2."/etc/shadow" Each of the above files have specific formats 1."/etc/passwd"
  • 4. If there is any issue at setup or connection contact [email protected] The above fields are  root=name  x=link to password file i.e./etc/shadow  0 or 1=UID(user id)  0 or 1=GID(group id)  root or bin = comment (brief information about the user)  /root or /bin = home directory of the user  /bin/bash or /sbin/nologin = shell 2."/etc/shadow" The above fields are  root = Username  $1$NPIb8zxz$d9t4mZUy/wlqhlFAsCwAx. = Encrypted Password  16416 = Days since that password was last changed.  0 = Days after which password must be changed.  99999 = Days before password is to expire that user is warned.  7 = Days after the password is expires that the user is disabled.  A reserved field Password Complexity Requirements:  a root user can change a password of self and of any user in the system, there are no rules for root to assign a password. Root can assign any length of password either long or short, it can be alphabet or numeric or both. On the whole there is no limitation for root for assigning a password.  A normal user can change only its password. a valid password for a normal user should adhere to the following rules.  it should be at least 7 characters but not more the 255 characters.  At least one character should be Upper Case.  At least one character should be Lower Case  At least one character should be a symbol, and one character should be a number.  It should not match the pervious password.  It cannot have sequence(ex:123456 or abcdef)  The login name and the password cannot be same.
  • 5. If there is any issue at setup or connection contact [email protected] Note: for security reasons don't keep the password based on date of birth because it can easily be hacked. Creating a user The Syntax for creating a user in Linux is #useradd <option> <username> Options are:  -u userid  -G Secondary Group id  -g Primary Group id  -d home directory  -c comment  -s shell Let's create a user with default attributes.  when no option is used with useradd command the options like UID,GID,home dir and shell will be assigned default  #useradd <username> Observe that the uid, gid, home dir, and shell is assigned automatically.
  • 6. If there is any issue at setup or connection contact [email protected] let's create a user with our own attributes  Name = pepsi  uid = 508  gid = 508 (primary group)  homedir = /home/pepsi  comment=beverages  #useradd pepsi -u 508 -g 508 -d /home/pepsi -c beverages Assigning a password to the user:  As a root user we can assign any password to any user.  The syntax for assigning a password is  #passwd <username> to assign a password to a specific user, only root can assign password to other user. Modifying the user's attributes  After creating a user if we need to modify the attributes of user like changing uid, changing secondary group id or adding a comment, locking or unlocking the user account, can be done by following command  usermod <options> <username>  All the options which are used with useradd command can be used and also the following below:  -l to change login name  -L to LOCK account  -U to UNLOCK account  ex.#usermod -l newname oldname (changing the name of the user)  ex.#usermod -L newname to lock the user account
  • 7. If there is any issue at setup or connection contact [email protected]  ex.#usermod -U newname to unlock the user account  Note:- When an account is locked it will show! (Exclamation mark) in /etc/shadow file Locking and unlocking a user account  To lock a user a/c use the following #usermod -L <username>  verify it in /etc/shadow file, it shows exclamation mark before user a/c or try login as pepsi  unlock the above user a/c use the following #usermod -U <username>  Verify it in /etc/shadow file, it shows exclamation mark before user a/c or try login as oracle  Try login as a user pepsi The password parameters  For any user we can set the parameters for the password, like min and max password age, password expiration warnings and a/c expiration date etc  To view the advanced parameters of the user, use #chage -l <user name>  #chage -l pepsi
  • 8. If there is any issue at setup or connection contact [email protected]  Last password change: when the password was change last time.  Password expires: Password expiry date  Password inactive: After password expiry grace period before the account gets locked.  Account expires: Date on which the account expires.  Minimum number of days b/w password change: Once the password is changed, it cannot be changed until a min period of specified date [0] means never.  Max number of days b/w password change: After changing the password how long it will be valid for.  Number of days of warning before password expires: start of warnings to change the password, no. of days before the password expires. Changing the password parameters can be done by two ways:-  chage <user name>  chage <option> <value> <username> Let's see the first method and then the other. To set the password parameters of a user "pepsi" to  Min password age: 2 days  Max password age: 7 days  password expiration warnings: 2 days before password expires  Password inactive[-1]:0 same day account is locked after password expiry.  A/C expiration date: 2014-12-31(dec 31st 2014)
  • 9. If there is any issue at setup or connection contact [email protected]  The second method is for, if you want to change a particular field of password aging policy  #chage <option> <value> <username>  -m for Min password age  -M for Maximum password age  -d for last time the password is changed.  -W Password expiration warnings  -I Password inactive [-1 means inactive]  -E A/c expiration date Let's see how to change only the account expiration date Likewise we can use any option listed above and change any particular field in password aging parameters Deleting a User:  To delete a user the sysntax used is  #userdel<username> it will only delete the user but home directory will be there. To delete the user with its home directory use the following command #userdel -r pepsi PART II GROUP ADMINISTRATION GROUPS  Users are assigned to groups with unique group ID numbers(the GID)  The group name and GID are stored in /etc/group  Each user is given their own private group  They can also be added to their groups to gain additional access.  All users in a group can share files that belong to the group. Each user is a member of at least one group, Called a primary group. In addition, a user can be a member of an unlimited number of secondary groups. Group membership can be used to control the
  • 10. If there is any issue at setup or connection contact [email protected] files that a user can read and edit. For example, if two users are working on the same project you might put them in the same group so they can edit a particular file that other users cannot access.  A user's primary group is defined in the /etc/passwd file and secondary groups are defined in the /etc/group file.  The primary group is important because files created by this user will inherit that group affiliation. Creating a group with default options:  Syntax for creating group is #groupadd <name of the group> creating a group with user specified group id(GID)  #groupadd <option><name for the group>  #groupadd -g 595 laptop  verify it in /etc/group
  • 11. If there is any issue at setup or connection contact [email protected] Modifying the properties of the group  Syntax is groupmod <option> <argument><group name>  The options are below:-  -g to change the group id  -o to override the previous assigned id, if it matches with the new one.  -n to change the group name. Changing the GID of the group  #groupmod -g 600 laptop  verify it in /etc/group Changing the name of the group  Syntax #groupmod -n <new name> <existing name>  groupmod -n lappy laptop
  • 12. If there is any issue at setup or connection contact [email protected] Adding and Removing members to a group  Adding the members to the group is to add users to the group. To add the members to the group the syntaxes are  To add single user to the group #usermod -G <group name> <user name>  #usermod -G computer mouse tail /etc/passwd tail /etc/group Adding multiple single or multiple users to the group with various attributes #gpasswd <option> <argument> <group name> Options:  -M For Adding Multiple users to a group  -A For Adding a group Administrator.  -a for adding a single user to a group.  -d removing a user from a group.
  • 13. If there is any issue at setup or connection contact [email protected] #gpasswd -M<user>,<user>,<user><group> #gpasswd -M keyboard,speakers,ram computer Adding a single user using gpasswd #gpasswd -a hardisk computer
  • 14. If there is any issue at setup or connection contact [email protected] Making a user as an administrator #gpasswd -A ram computer (verify it in /etc/gshadow) removing a user from the group #gpasswd -d speakers computer To add and remove groups you can also use graphical tool in linux #system-config-users &
  • 15. If there is any issue at setup or connection contact [email protected]
  • 16. If there is any issue at setup or connection contact [email protected] =============End of the Activity 4 Guide========