~~~~~ Warning !!! Content posted here are gained through the real world experience or some may come from training or any other Internet sources. Reading this blog may confuse you or may increase understanding of UNIX/Linux operating system and its component. It might help you to land on Real job or may fire your from the Real job. So, use on your own risk !!! No left or right reserved !!! -Kamal ~~~~~
Saturday, February 9, 2013
Creating user manually using vi
Creating user manually using vi
To add user manually using vi
a. user vipw command and go to end of the page and yang the current user info and paste. Change the user name, id, home directory and other relevant info.
b. use passwd command to change the just created user password.
c. vigr to add group entry, yank existing users group and paste. make changes according to the user group.
d. vigr -s to add entry to gshadow.
e. Create user's home directory and copy login initialization files from /etc/skel directory.
Note: When you use cp command to copy the files, it does not include hidden files. To turn on this feature, run the following command.
[root@my32GB ~]# shopt -s dotglob
[root@my32GB ~]# cp /etc/skel/* /home/ramila/
Once done, turn it off (unset) using the following command,
[root@my32GB ~]# shopt -s dotglob
======= detail =======
[root@my32GB ~]# vipw
[root@my32GB ~]# cp -a /etc/skel/.??* /home/ramila/
[root@my32GB ~]# vipw -s
or to set user password,
[root@my32GB ~]# passwd ramile
[root@my32GB ~]# vigr
[root@my32GB ~]# id ramila
[root@my32GB ~]# vigr -s
[root@my32GB ~]# mkdir /home/ramila
[root@my32GB ~]# cp -a /etc/skel/.??* /home/ramila/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment