Linux

How to add, delete, modify users and groups in Linux #2

Adding and removing users, groups are important tasks performed by every administrators. in this topic you can find how yo add, delete user or group.

Users

Add a user

1. Open terminal and login as root user mode

#sudo Su
then type your password

 


2. To add new user use the useradd command and to set the password for that user use passwd command as shown below.

#useradd name_of_the_user

#passwd username

Whenever you add/ remove/modify a user, three configuration files should be modified in the /etcdirectory.

1.       /etc/passwd

2.       /etc/groups

3.       /etc/shadow

The password configuration file modification

A new user properties containing username,password,userid,groupid,home directory fields are added when an user is created in the configuration file.

user1:x:1001:1001::/home/user1:/bin/sh

The representation of the six fields are

Field 1 = username = user1

Field 2 = password  = xxxx ( encrypted text )

Field 3 = userid =1001

Field 4 = group id = 1001

Field 5 = home directory = /home/user1

Field 6 = Shell = /bin/sh

The user id 0-499 is allocated for the system user and the new user starts from the user id 500 (for Redhat and Fedora).

The user id 0 -1000 is allocated for the system user and the new user starts from the user id 1001 (for Ubuntu )

The Shadow Configuration file modification

The shadow configuration file contains username and encrypted password. The Shadow configuration file is present in the /etc/shadow directory.

The group configuration file modification

The group configuration file contains user name, encrypted password and user id. Whenever a user is created group name is automatically created with the username. Group id are stored in /etc/groupdirectory.

Groups

Add a group

Users are assigned to a group. Each group is assigned  a unique Group id number. Group id are stored in the /etc/group. All users in a group can share files that belong to the group.

To add a new group

#groupadd name_of_the_group

If you want to add a user to a particular group at the time of user creation

#useradd –g groupname username

The group configuration file is modified as show in the figure

The shadow configuration file is modified as show in the figure

Delete a user

To delete a user  userdel command is used.

#userdel username

The information associated with the user is also deleted in the configuration files.

Remove a group

To delete a group groupdel command is used.

#groupdel groupname

The  information associated with the group is also deleted in the configuration files.

Install Linux Ubuntu without formatting your hard #1

For beginners in Linux and who are interested in testing it without losing any data  due to the need of formatting a partition of the Hard disk there are many easy ways to enjoy using Linux without Formatting ! 

 
Way One (Virtual Machine)
if u have 10 GB free in any partition from your hard all what u need to do is to install VMware player that create a virtual machine on your computer, it shares some of your computer resources  according to your choice during thr VMware setup 
you can download the VMware player from here 

and download Linux Ubuntu from here 
then enjoy using Linux Ubuntu while using windows without any losses 
 
Way Two (Wubi)
if u have the same 10 GB or less, you can download Ubuntu Windows(Wubi.exe) installer only 2.4 MB ! 
and download Linux Ubuntu from here 
 
double click on Wubi after downloading and enjoy using Linux 
 
OR Ubuntu provides very simple demo to know more about Linux Ubuntu 
                                       enjoy!
NoteLinux community provides many other simple ways to enjoy using Linux !