Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

User and Group Administrator

User and Group Administrator

There are three type of user account in Red hat Linux

    1. Super user or Administrative account
    2. Regular user account
    3. service account
  1. Super User created automatically at the time of installation
  2. Regular user Account;
  1. Using command line method ‘useradd’ or ‘adduser’ command
  2. Graphical method by using Red hat user manager utility

a.

# adduser user_name (Recommended : minimum 6 character used in password)

# passwd user_name

Example:

#adduser rakesh

#passwd rakesh

Now open the file /etc/passwd to check the entry of user

#vi /etc/passwd

it contain 7 entry of each user

  1. Username
  2. Password
  3. userid
  4. groupid
  5. blank (User information field ) comment
  6. home directory
  7. login shell

password entry for each user will be stored in /etc/shadow

# vi /etc/shadow

now in order to check the Userid, Group we use /etc/login.def

# vi /etc/login.def

when any user account is created then user will get userid, groupid automatically from /etc/login.def

5th field is used for user information or comment

6th field is used for home directory. When any user is created its default home directory is created inside /home

/home/rakesh

7th field is login shell. Default shell for user is /bin/bash

different shells are used

ksh, sh, csh, tcsh,zsh

shell is an user interface between user and O.S. linux command shell is a prompt that allow us to interact with our system by executing various command.

In order to check the shell available use /etc/shells

# vi /etc/shells

in order to get the information about the group we need /etc/group

#vi /etc/group

it contain four field

  1. Group name
  2. password
  3. GroupId
  4. Member of group

# finger : this command is used to get the information about the user

Syntax:

#finger username

#finger rakesh

#id : this command is used to get userid, groupid of the user

syntax:

#id username

#id rakesh

Creating Group:

Syntax:

#groupadd groupname

#groupadd –g gid groupname

Example:

#groupadd raj

Exercise:

Create a user that should have uid=1000 shell=sh description and home directory as /data

Sol:

#useradd –u 1000 –c rakeshpundir –s /bin/sh –d /data rakesh

#passwd rakesh

Grpahically

System Setting :-> User & Group

OR

#system-config-user

Every user have two group one is elementary group or primary group and secondary group

-g : Primary Group

-G : Secondary Group

Creating Group

#groupadd g1

#groupadd g2

Steps:

1. adding group to the user

#usermod –g g1 –G g2 rakesh

2. To change id of the user

#usermod –u 1001 rakesh

3. change comment

#usermod –c rakeshsingh

4. change home directory

#usermod –d /rakesh-home rakesh –m

5. change shell

#usermod –s /bin/bash rakesh

6. change user login name

#usermod –l newname oldname

#usermod –l rajesh rakesh

7. Change Group name

#groupmod –n newname oldname

#groupmod –n group1 g1

8. change Group id

#groupmod –g 2005 group1



This post first appeared on RED HAT ENTERPRISE LINUX, please read the originial post: here

Share the post

User and Group Administrator

×

Subscribe to Red Hat Enterprise Linux

Get updates delivered right to your inbox!

Thank you for your subscription

×