Presentation Hidaya

Embed Size (px)

Citation preview

  • 7/29/2019 Presentation Hidaya

    1/15

  • 7/29/2019 Presentation Hidaya

    2/15

    USERS & GROUPS IN LINUX

    SALMAN ARAIN

    ID # 3749

  • 7/29/2019 Presentation Hidaya

    3/15

    OUTLINES:

    Users & Groups

    How to Create User & Groups

    How to add a particular user in a group

    Some useful commands and options.

  • 7/29/2019 Presentation Hidaya

    4/15

    USERS:

    The control ofusers andgroups is a core

    element of Fedora system administration.

    Users can be either people or accounts

    which exist for specific applications to

    use.

  • 7/29/2019 Presentation Hidaya

    5/15

    GROUPS:

    Groups are logical expressions oforganization, tying users together for acommon purpose.

    Users within a group can read, write, orexecute files owned by that group.

    Each user is associated with a unique

    numerical identification number called auserid(UID); likewise, each group isassociated with agroupid(GID).

  • 7/29/2019 Presentation Hidaya

    6/15

    CONTD:

    A user who creates a file is also the ownerand group owner of that file.

    The file is assigned separate read, write, and

    execute permissions for the owner, thegroup, and everyone else.

    The file owner can be changed only by the

    root user, and access permissions can bechanged by both the root user and fileowner.

  • 7/29/2019 Presentation Hidaya

    7/15

    CONTD:

    By default, all users home directory iscreated & maintained in /home directoryand root user home directory is at /root.

    The first regular user account created onthe system always assigned a UID of 500 andso on, and the root user account is alwayshave a UID of 0.

    Its this UID that the operating systemactually uses to control access to files anddirectories in the file system.

  • 7/29/2019 Presentation Hidaya

    8/15

    Some Important Files

  • 7/29/2019 Presentation Hidaya

    9/15

    USER MANAGEMENT:

    Using useraddSyntax: useradd options username

    Using passwd

    Syntax: passwd options username

    Using usermod

    Syntax: usermod options username

    Using userdel

    Syntax : userdel options username

  • 7/29/2019 Presentation Hidaya

    10/15

    Some Useful Options for Useradd :

    -c Add a description about the user

    -d Specify the home directory of user

    -e Define expiry date of user account

    -g Specify the primary group of useraccount.

    -G Specify the supplementary groups

    -M Ensure that users home directory isnot created

    -n specify user id

  • 7/29/2019 Presentation Hidaya

    11/15

    Some useful Options for usermod:

    -c Modify description of user account

    -d Modify home directory

    -e Modify account expiry date

    -g Modify the primary group

    -G Modify the supplementary groups

    -l Modify the login name of an existing user account

    -u Modify a user-id of a user account

    -L Lock an existing user account

    -U Unlock a locked user account

  • 7/29/2019 Presentation Hidaya

    12/15

    Userdel option:

    By default, userdel will not remove the usershome directory from the file system.

    To remove that from home directory, whenyou delete the user, you need to use the r

    option in the command line.

    For instance, userdel r username

    userdel f username

  • 7/29/2019 Presentation Hidaya

    13/15

    GROUP MANAGEMENT:

    Using groupadd

    Syntax: groupadd options groupname

    Using groupmodSyntax: groupmod options file

    (-n, -g)

    Using groupdel

    Syntax: groupdel groupname

  • 7/29/2019 Presentation Hidaya

    14/15

    LINUX gpasswd command for

    Group Management:

    Linux systems provide the gpasswd command for adding andremoving members of groups and for specifying groupadministrators.

    # gpasswd -a aqeel talha

    # gpasswd d aqeel talha

    The -A and -M options are used to specify the list of groupadministrators and additional group members.

    # gpasswd -A salman muet

    The list of users specified as the argument to either option iscomma-separated and must not contain any internal spaces.

  • 7/29/2019 Presentation Hidaya

    15/15