,
Share with your friends 

user creation using vipw

0 ratings Views 239 
Author: linuz (yakub pasha)  View Profile |  View other solutions by this author

Question / Problem


is there any alternate way to create user without using "user add" ?

Solution

ya there is a way to create a user using vi editor..
there is a command called    " vipw".   means that editing the /etc/passwd file by using  vi editor.
when you issues that command it opens the /etc/passwd  file  then  select  any line cpoy that line by "yy"(yanks the line in buffer ) and paste that line at the end of the file(the last line) and change the username which exist in the first field
  #vipw
  
it conatains the lines looks like
   yakub:x:200:200:yakub:/bin/bash
(here yakub is the username just change the your desired user name in that field and change the group name in the fifth field).
after completing the editing just save and exit from vi by using

:wq!
here it will ask a query to edit the shadow password press 'y' to edit(don't press n because authentication failed if you want to set a password ).
here also copy one line  and paste at the end of the file by editing the first field  with your user name
when you want to set a password for your created user name just use the following command
#passwd your username
and disadvantage here is to create the user home directory by user itself only and give the permissions to the home directory of the user as 755 by using the following command
#chmod 755 /home/username


this is a time consuming process but you have to know it and it will be very useful in some certification exams..


Applies to

Red Hat Linux ,Linux, Unix

Rank It

Login to rank it

Report


Advertisement