Session7 Theory

Embed Size (px)

DESCRIPTION

linux ppt 7

Citation preview

  • 5/20/2018 Session7 Theory

    1/11ADVANTAGE PROChennais Premier Networking Training Centre

    Useradd :

    To create a new user account and login directory for that

    new account.

    Useradd will create new entries in system files.Syntax

    useradd [options] [user]

    Options

    -c Comment field.

    -d Home directory

    -e Account expiration date.

    useradd command

  • 5/20/2018 Session7 Theory

    2/11ADVANTAGE PROChennais Premier Networking Training Centre

    Passwd comand

    Passwd:

    The passwd command is used to set the password for the user.

    Syntax

    passwd Example:

    #passwd tom

    - this example set password for tom user.

    #passwd

    - this example set password for current loin user.

  • 5/20/2018 Session7 Theory

    3/11ADVANTAGE PROChennais Premier Networking Training Centre

    Userdel command

    Userdel

    The userdel command is used to delete a user account

    Syntax

    userdel -r.

    Example

    userdelr tom

    - this command delete user account as tom

    userdel tom

    - this command delete user account tom but can notdelete a home directory of tom user.

  • 5/20/2018 Session7 Theory

    4/11ADVANTAGE PROChennais Premier Networking Training Centre

    User configuration files

    When a new user account is created, itsentries updates the following system files.

    - /etc/passwd

    - /etc/group

    - /etc/shadow

  • 5/20/2018 Session7 Theory

    5/11ADVANTAGE PROChennais Premier Networking Training Centre

    Creating groups

    New group is created by hand-editing the file /etc/group or by using

    groupadd command.

    Syntax:

    groupadd groupname

    groupdel command is used to remove the group.

    Syntax

    groupdel groupname

    Groupmod is used to rename the existing groupname.

    Syntax:

    groupmod n newname oldname

  • 5/20/2018 Session7 Theory

    6/11ADVANTAGE PROChennais Premier Networking Training Centre

    chage commandThe chage command let you specify an expiration limit for a user's

    account and password .

    Syntax:

    chage [option] username

    Option

    -l lists the current password expiration.

    -m set the min. days to change the password.

    -M set the max. days to change the password.

    -E specific expiration date for user account.

    -I set inactive period (in days)-W warning period, number of days before

    expiration.

  • 5/20/2018 Session7 Theory

    7/11ADVANTAGE PROChennais Premier Networking Training Centre

    Set userID

    It allows an executable file to run under the user or group security

    context with the permission of its owner.

    SUID can be set as follows:

    chmod u+s [filename]

    (or)

    chmod 4xxx [filename]

  • 5/20/2018 Session7 Theory

    8/11ADVANTAGE PROChennais Premier Networking Training Centre

    Set groupID

    Set groupID

    Set groupid are also set to directory, any user creating file in that

    directory, the file group is directory group name.SGIP can sets as

    chmod g+s directory

    or

    chmod 2xxx directory

  • 5/20/2018 Session7 Theory

    9/11ADVANTAGE PROChennais Premier Networking Training Centre

    Sticky bit

    Sticky bit:

    Stricky bit is set to the directory, so that only the owner can

    delete their own file even the others have write permissions.

    Sticky bit can sets as

    chmod +t directory

    or

    chmod 1xxx directory

  • 5/20/2018 Session7 Theory

    10/11ADVANTAGE PROChennais Premier Networking Training Centre

    Switch user

    su command is used to switch to another account from the

    command line.

    This command is most often used by system administrator totemporarily become the root user without logging out of their non-

    privileged account.

    Syntax

    su - [user] -c command

  • 5/20/2018 Session7 Theory

    11/11ADVANTAGE PROChennais Premier Networking Training Centre

    Multi user login

    Like unix operating system where multi user login can be done, in

    same sense the Linux operating system supports multi user login.

    Each user can login in each terminal and can do multi processing

    which avoids logging off from the system.